Solved

How to access password protected MS Access database.

Posted on 2002-06-06
8
136 Views
Last Modified: 2010-05-02
I have a MS Access database having password protected. I want to access this database by using Visual Basic ADO. How can i access this databse. I am able to access this databse if it is not password protected. Please let me know as soon as possible.
Thanks..
+Anil
0
Comment
Question by:anilgupt
8 Comments
 
LVL 5

Expert Comment

by:kcm76
ID: 7061284
if u use dsn :
Cn.Open "DSN=<dsnname>;Uid=<Uid>;Pwd=<Password>"

if dsnless connection

Cn.Open "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & app.path & "\database.mdb;Pwd=<password>"

0
 

Author Comment

by:anilgupt
ID: 7061300
If you don't mind, Please try this yourself. Actually i tried it and it doesn't work.
+Anil
0
 
LVL 1

Expert Comment

by:harsh008_k
ID: 7061327
hi anil,
what kcm has given is correct

example is like this

Dim cnInvoice as adodb.connection

Set cnInvoice = New ADODB.Connection

cnInvoice.Open "dsn=Sankhla;uid=;pwd=anil;"

to create a dsn
1)choose odbc from control panel.
2)choose userdsn,then select add
3)choose Microsoft Access Driver(*.mdb)
5)Select Finish
6)Give a name to your datasource(dsn)
7)Select the Database

and use the same dsn in your code and the password
it should run

good luck anil

Harsha
0
 

Author Comment

by:anilgupt
ID: 7061331
Hi Harsha,
Sorry, i forget to mention about DSN less connection. Actually I need help in accessing databse using dsn less connection only.
You are right for DSN connection.

+Anil
0
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.

 
LVL 1

Accepted Solution

by:
Benjy earned 50 total points
ID: 7061432
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
          "Data Source=locationpath\file.mdb" & _
         "Jet OLEDB:Database Password=mypasword;"
0
 

Author Comment

by:anilgupt
ID: 7061456
Hi Benjy,
You gave the right solution of this problem.
Thanks,
+Anil
0
 
LVL 1

Expert Comment

by:harsh008_k
ID: 7061542
anil,
remember to reciprocate the efforts of others as well.They 2 have invested their time.nobody will respond to u if write a comment like that and dont take this forum to be for granted
0
 

Author Comment

by:anilgupt
ID: 7061549
Harsha,
What do u want to say to me. I am not getting your point.
+Anil
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

Suggested Solutions

Title # Comments Views Activity
VBA loop through headers using value 3 57
Problem to skip loop 6 55
VB6 Compile Compatibility Issue 4 89
MsgBox 4 46
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

910 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

22 Experts available now in Live!

Get 1:1 Help Now