Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-03-02
6
Medium Priority
?
394 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 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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

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 is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Sometimes Administrators rights are not enough. These cases call for the SYSTEM account. The process in this article outlines the steps required to execute commands using the SYSTEM account.
A new hacking trick has emerged leveraging your own helpdesk or support ticketing tools as an easy way to distribute malware.
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

609 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