Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB8.0 VB ADO.NET Access
Updated
 
This is my question.
 
I will set a password to my database created using MS Access 2007. I will place at my 'Connection-string' statement which in ADO.NET 2.0 using VB 2005. But if I change the password I will have to recreate my setup file and install the new version to the computer.
 
I heard that, that kind of information (the DBMS password) can be stored in an XML file and then that XML file can be read to get the password. If the DBMS password reset, only have to edit that particular XML file only. Then no need to recompile or create a new setup file.
 
In ASP.Net 2.0 has a option called as appConfig. But I will develop windows application not web application.
 
So I want to know how to and where should store my DBMS password in the XML.
Also I want to know how to read that particular XML file and the password and where should i place that XML file when the
system is being developed.


 
If any you guys want to help me don't think this is a naive idea!
 
Thanks a lot!
Posted 12-Nov-11 1:39am
Edited 12-Nov-11 15:57pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can store the password any way you want. If you know how to read and write data to a file, you're all set. XML is one option but I'm sure you can think of others.
 
The "Microsoft" way of doing this is using the application's settings file.
 
Application Settings Overview[^]
 
How to: Create Application Settings Using the Designer[^]
 
Then just read the password and add it to your connection string, or use a ConnectionStringBuilder[^]
  Permalink  
Comments
Chiranthaka Sampath at 12-Nov-11 20:38pm
   
In here you have mentioned about VB 2010. But my requirement is vb 2005. The articles you have produced are much complex than I think. Please solve my problem!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 277
1 Maciej Los 230
2 BillWoodruff 205
3 Sergey Alexandrovich Kryukov 195
4 DamithSL 165
0 OriginalGriff 5,130
1 DamithSL 4,157
2 Maciej Los 3,650
3 Kornfeld Eliyahu Peter 3,460
4 Sergey Alexandrovich Kryukov 2,811


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 12 Nov 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100