Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Data Source Password
 

Data Source Password

My project has an access database, I have added the database via 'Add New Data Source' into my project and DatSet.xsd. I am trying to add a password to protect it when installed using SetUp.msi on the clients machine. I have entered a password in the Add Connection dialog box but when installed on the clients machine the database is not protected.

Help would be appreciated.

latoc

latoc  Friday, July 31, 2009 11:59 AM
Hi latoc,

My suggestion is just like part of what you have done. You can store the password in the config file. Not in the connectionstring. Add another node to the config xml, for example, named password. When you load your application, check that node value, if it is empty, popup a dialog let your user to input password. Then store it in that node's value field. Build your real connection string in the code put the password into that string.

Sincerely,
Kira Qian
Please mark the replies as answers if they help and unmark if they don't.
  • Marked As Answer bylatoc Monday, August 03, 2009 4:58 PM
  •  
Kira Qian  Monday, August 03, 2009 9:28 AM

I have found a solution but would be grateful for advice to its correctness.

Set Password in the Database > select Add New Data Source > Add Connection > Set Password.

Connection String "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = |DataDirectory|\MyData.mdb;Jet OLEDB:Database Password=1234;"

latoc

latoc  Friday, July 31, 2009 8:24 PM
Hi latoc,

My suggestion is just like part of what you have done. You can store the password in the config file. Not in the connectionstring. Add another node to the config xml, for example, named password. When you load your application, check that node value, if it is empty, popup a dialog let your user to input password. Then store it in that node's value field. Build your real connection string in the code put the password into that string.

Sincerely,
Kira Qian
Please mark the replies as answers if they help and unmark if they don't.
  • Marked As Answer bylatoc Monday, August 03, 2009 4:58 PM
  •  
Kira Qian  Monday, August 03, 2009 9:28 AM
Hello Kira

Thank for your help. I will incorporates your suggestion into my SetUp project.

Regards
latoc
latoc  Monday, August 03, 2009 4:57 PM

You can use google to search for other answers

Custom Search

More Threads

• Problems trying to include 3.0 framework with msbuild
• ClickOnce - Wasted Disk Space
• RemovePreviousVersions & GAC installation
• Distribute Database in Application
• RemotingConfiguration.Configure does not Work with Web Deployd Applications
• OneClick deployment to authenticated users
• Error build Setup project if lage file added
• were does install routine put program And how to tell it to install data files
• Fatal error during installation of .NET Framework 3.5 - please help
• Where exactly are the apps installed