Solved

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

Posted on 2011-03-02
6
391 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 85
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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Many of you may be aware of the recent Google Docs scam emails that have been floating around coming from various people that you know. Here's a guide on identifying How To Identify the Scam Email You will see an email from someone you’ve had co…
Liquid Web and Plesk discuss how to simplify server management with a single tool  in their webinar.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

707 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