Solved

How to access password protected MS Access database.

Posted on 2002-06-06
8
139 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
[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
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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
 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

738 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