anilgupt
asked on
How to access password protected MS Access database.
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
Thanks..
+Anil
ASKER
If you don't mind, Please try this yourself. Actually i tried it and it doesn't work.
+Anil
+Anil
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
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
ASKER
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Benjy,
You gave the right solution of this problem.
Thanks,
+Anil
You gave the right solution of this problem.
Thanks,
+Anil
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
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
ASKER
Harsha,
What do u want to say to me. I am not getting your point.
+Anil
What do u want to say to me. I am not getting your point.
+Anil
Cn.Open "DSN=<dsnname>;Uid=<Uid>;P
if dsnless connection
Cn.Open "Provider=Microsoft.Jet.Ol