Problem opening a password protected .MDB 
Author Message
 Problem opening a password protected .MDB

Hello,

I'm trying to open a password protected access97 database :
Set DB = Ws.OpenDatabase(Db_name, , , "pwd=secret")

I always get : Run-time error 3031 -  Not a valid password

Can anyone help ?

Thanks, Wim



Mon, 10 Dec 2001 03:00:00 GMT  
 Problem opening a password protected .MDB
try this, it works for me

strconnect = ";DATABASE=" & App.Path & "\cp.mdb" & ";PWD =" & "mypassword"
Set db = DBEngine.OpenDatabase("", True, False, strconnect)

Quote:

>Hello,

>I'm trying to open a password protected access97 database :
>Set DB = Ws.OpenDatabase(Db_name, , , "pwd=secret")

>I always get : Run-time error 3031 -  Not a valid password

>Can anyone help ?

>Thanks, Wim




Mon, 10 Dec 2001 03:00:00 GMT  
 Problem opening a password protected .MDB
As a beginner programmer I just had to figure it out so here is the answer:
If you are using a DATA object, in the FORM LOAD procedure type in the
following code:

WITH DATA1
 .DatabaseName = "c:\wherever the files is\database.mdb"
 .RecordSource = "NameOfTheTable"
 .Connect=";Pwd=WhateverThePassword"
 .Refresh
END WITH

Feel free to cut and paste this and just change the path, table name, and
the password.

Rafal

Quote:

>Hello,

>I'm trying to open a password protected access97 database :
>Set DB = Ws.OpenDatabase(Db_name, , , "pwd=secret")

>I always get : Run-time error 3031 -  Not a valid password

>Can anyone help ?

>Thanks, Wim




Mon, 10 Dec 2001 03:00:00 GMT  
 Problem opening a password protected .MDB
The answer:

First use to commas (,)
second start the pwd-string with ";pwd..."

So

Set DB = Ws.OpenDatabase(Db_name, ,  ";pwd=secret")

Quote:

>Hello,

>I'm trying to open a password protected access97 database :
>Set DB = Ws.OpenDatabase(Db_name, , , "pwd=secret")

>I always get : Run-time error 3031 -  Not a valid password

>Can anyone help ?

>Thanks, Wim




Tue, 11 Dec 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Open the password protected MDB with VB

2. 'how to open an password protected access mdb file

3. 'how to open an password protected access mdb file

4. 'how to open an password protected access mdb file

5. 'how to open an password protected access mdb file

6. open password protected (.mdb file)

7. Problems with ADO Data Control connecting to a Password Protected MDB

8. problems opening password-protected Access 2k db

9. Reading a password protected MDB with VB

10. VB5 and PASSWORD Protected MDB file.

11. VB4 with password protected MDB

12. Password protected Access.mdb from VB?

 

 
Powered by phpBB® Forum Software