???VB 5 CODE OPEN ACCESS DATABASE???? 
Author Message
 ???VB 5 CODE OPEN ACCESS DATABASE????

How do I open a secured database from vb5 that also has a database password.
I open it like this:

dbUser = "mike"
dbUserPassword = "123"
DatabasePassword = "xxx"
DBEngine.SystemDB = "SB.mdw"
DBEngine.DefaultUser = dbUser
DBEngine.DefaultPassword = dbUserPassword
DBEngine.DefaultType = dbUseJet
Set dbWS = DBEngine.CreateWorkspace("", dbUser, dbUserPassword)
Set db = OpenDatabase(gMainDBPathAndName)

But if I assign a database password in access to the database then I have no
idea where to place the password or what syntax to use...

Thanks



Thu, 28 Dec 2000 03:00:00 GMT  
 ???VB 5 CODE OPEN ACCESS DATABASE????
Try,

Dim db As Database

set db = OpenDatabase(App.Path & "\dbname.mdb", False, False, ";PWD=
password")

Dont forget the semicolon!

etta

Quote:

>How do I open a secured database from vb5 that also has a database
password.
>I open it like this:

>dbUser = "mike"
>dbUserPassword = "123"
>DatabasePassword = "xxx"
>DBEngine.SystemDB = "SB.mdw"
>DBEngine.DefaultUser = dbUser
>DBEngine.DefaultPassword = dbUserPassword
>DBEngine.DefaultType = dbUseJet
>Set dbWS = DBEngine.CreateWorkspace("", dbUser, dbUserPassword)
>Set db = OpenDatabase(gMainDBPathAndName)

>But if I assign a database password in access to the database then I have
no
>idea where to place the password or what syntax to use...

>Thanks




Thu, 28 Dec 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to open a password Access database from VB (code only)

2. How to open another database from within Access using code

3. Open different database file within Access using code

4. Open remote Access database in ASP code

5. Error code when opening an access database

6. Creating new Access 97 database by VB code in Access 2000 module

7. Importing an Access 2000 table into another Access 2000 database with VB Code

8. Is there a way to open Access through automation but skip auto open code

9. Opening a db within Access VB code

10. Doubut on opening Access 97 Database in VB 5

11. Open MS Access database from VB .exe file (Shell)

12. Using VB.NET to open an Access database...

 

 
Powered by phpBB® Forum Software