Connecting to (passworded) Access 97 from VB

  • Thread starter Thread starter Arthur Flood
  • Start date Start date
A

Arthur Flood

What is the code to connect to Access 97
from VB. The Access 97 file has the password "CORVETTE"

Below is the code that I would normally use.
What changes would have to be made to my VB code, if
my Access database has the password "CORVETTE"

Public DB1 As Database
Set DB1 = OpenDatabase("C:\TEMP\EMPLOYEES")
 
What is the code to connect to Access 97
from VB. The Access 97 file has the password "CORVETTE"

Below is the code that I would normally use.
What changes would have to be made to my VB code, if
my Access database has the password "CORVETTE"


Public DB1 As Database
Set DB1 = OpenDatabase("C:\TEMP\EMPLOYEES")

Try:

Set DB1 = OpenDatabase("c:\MyData\MyData.mdb", _
False, False, ";pwd=CORVETTE")
 
Set DB1 = OpenDatabase("c:\MyData\MyData.mdb", _
False, False, ";pwd=CORVETTE")

Sorry, that's:

Set DB1 = OpenDatabase("C:\TEMP\EMPLOYEES"_
False, False, ";pwd=CORVETTE")
 
Bruce M. Thompson said:
Sorry, that's:

Set DB1 = OpenDatabase("C:\TEMP\EMPLOYEES"_
False, False, ";pwd=CORVETTE")

Actually, it's

Set DB1 = OpenDatabase("C:\TEMP\EMPLOYEES", _
False, False, ";pwd=CORVETTE")

(you forgot the comma after the database name)
 
Back
Top