Solved

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

Posted on 2011-03-02
6
381 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
Comment Utility
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
Comment Utility
How does your .NET app connect to the database?
0
 
LVL 6

Assisted Solution

by:Chuck Yetter
Chuck Yetter earned 250 total points
Comment Utility
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:Daaf1
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This story has been written with permission from the scammed victim, a valued client of mine – identity protected by request.
This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

743 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

17 Experts available now in Live!

Get 1:1 Help Now