Solved

Conneting .NET windows app to a password secured MS Access Database

Posted on 2011-03-02
6
385 Views
Last Modified: 2012-06-27
Hi,

I've created a Windows App which works with a MS Access Database.
I don't use an external app.config file, so it is integrated in the installer.

When i use the app with the db without password protection everything works fine.
Then when i set a password for the db and set it also in the Connection properties window (With the remember my password checked) the connection test result is fine, but when i run my app i get an Error that says "Not a valid password."

What am i missing?
0
Comment
Question by:Daaf1
6 Comments
 
LVL 10

Accepted Solution

by:
John Claes earned 250 total points
ID: 35015843
the remember password is a option for the programming environment, not for the app.
So you have to set the password in the connectionstring that is saved inside the app.

in the app.settings (are compiled inside your app) the connectionstring is saved.

regards

poor beggar
0
 
LVL 84
ID: 35015979
How does your .NET app connect to the database?
0
 
LVL 6

Assisted Solution

by:Chuck Yetter
Chuck Yetter earned 250 total points
ID: 35016664
Your connection string could look something like

string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\someDirectory\nameOfYourDatabase.mdb;Jet OLEDB:Database Password=yourPassword";

Then set your table adapters or OleDbConnections to use that.  There are also other things which can be set in the connection string, like "Persist Security Info=False" or "Encrypt Password=False" etc..
0
Free camera licenses with purchase of My Cloud NAS

Milestone Arcus software is compatible with thousands of industry-leading cameras for added flexibility. Upon installation on your My Cloud NAS, you will receive two (2) camera licenses already enabled in the software. And for a limited time, get additional camera licenses FREE.

 

Author Comment

by:Daaf1
ID: 35016702
Hi all,

I tried to set the password in the settings.settings file. Now the result is the following error:

"Cannot start your application. The workgroup information file is missing or opened exclusively by another user."

I don't know if maybe the problem lies in the way i set the password for the DB:

I opened the .mdb exclusive, then went to set password and set one.
I didn't do anything with the "WorkGroup information file". I don't really understand that (yet).

How do i connect with the DB?

I have set up a simple Homenetwork, nothing fancy...
I run two apps on two different machines. One of the machines functions as db-bearer.
The bearer machine links through the ConnectionString dirtect to it's harddisk, the satellite links, also through the ConnStr, to the bearers harddisk. The disk of the bearer is set to be shared and can be modified by the satellite.
Is that enough info?
0
 

Author Comment

by:Daaf1
ID: 35016726
Axshun:

My connectionString does look like that... Just fails the @ sign in the beginning.
But all functions well when using the unprotected db...
0
 

Author Comment

by:Daaf1
ID: 35017797
Ok guys,

I found the problem.
Apparently VS put extra password notation in the connectionString. One i got it out of the way, things went smoothly... until i tried to use one of the integrated Crystal Reports, it asked me for the password.
I guess i have to make a new inquiry for the new problem...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By this time the large percentage of day-to-day transactions have shifted to mobile banking; here are some overriding areas QAs must investigate while testing mobile banking apps.  
Three simple tips to quickly and efficiently back up and protect the contents of your PC and Mac®.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now