?
Solved

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

Posted on 2011-03-02
6
Medium Priority
?
396 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 1000 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 85
ID: 35015979
How does your .NET app connect to the database?
0
 
LVL 6

Assisted Solution

by:Chuck Yetter
Chuck Yetter earned 1000 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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

What Security Threats Are We Predicting for 2018?

Cryptocurrency, IoT botnets, MFA, and more! Hackers are already planning their next big attacks for 2018. Learn what you might face, and how to defend against it with our 2018 security predictions.

Question has a verified solution.

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

When you put your credit card number into a website for an online transaction, surely you know to look for signs of a secure website such as the padlock icon in the web browser or the green address bar.  This is one way to protect yourself from oth…
Your business may be under attack from a silent enemy that is hard to detect. It works stealthily in the shadows to access and exploit your critical business information, sensitive confidential data and intellectual property, for commercial gain. T…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

862 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