Open database with password 
Author Message
 Open database with password

Hi everyone

I'm using Access 7.0 for Windows 95.
If the database "Sample.mdb" in the following VB Code is secured by the
password - let's say - "123". How do I amend the Code so that the
database can be opened?

Private Sub btnTest2_Click()
    Dim db As DATABASE, rs As Recordset
    Set db = OpenDatabase("C:\123\Sample.mdb")
    Set rs = db.OpenRecordset("tblSample")
End Sub

Appreciate any help
Dominik



Sat, 01 Jun 2002 03:00:00 GMT  
 Open database with password
Public Const DatabaseName =  "MyDatabase.MDB"
Public Const DatabaseNamePW = ";pwd=MyPassword"
Public db1 As Database

Sub main()
    Set db1 = OpenDatabase(DatabaseName, False, False, DatabaseNamePW)

End Sub
--

Patrick Garceau




Quote:
> Hi everyone

> I'm using Access 7.0 for Windows 95.
> If the database "Sample.mdb" in the following VB Code is secured by the
> password - let's say - "123". How do I amend the Code so that the
> database can be opened?

> Private Sub btnTest2_Click()
>     Dim db As DATABASE, rs As Recordset
>     Set db = OpenDatabase("C:\123\Sample.mdb")
>     Set rs = db.OpenRecordset("tblSample")
> End Sub

> Appreciate any help
> Dominik



Sat, 01 Jun 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. open database with password

2. Opening database with password

3. How to Open Database having password, use OpenDatabase Method

4. Open database with password

5. Opening database with password

6. Opening database with password

7. How open database with password?

8. Open Database with Password

9. Cant open DataBase with password

10. Opening database with password

11. #### Please : VB ---> DAO ----> Access97 / Open Database with Password

12. Open a password protected database with DAO

 

 
Powered by phpBB® Forum Software