>> dao connect with password

G

Guest

Hi I want to connect to a data file that has a database password "hello"

I can manually link to a table in this database and using the debug window,
Debug.Print tdf.Connect returns

MS Access;PWD=hello;DATABASE=T:\DHLdata.mdb

Now using the line

Set gDBData = Workspaces(0).OpenDatabase("T:\DHLdata.mdb", , , "pwd=hello")

fyi: Public gDBData As dao.Database

I get error 3031, Not a valid password

I'm sure that this is really basic... what is the correct syntax for this?

Many thanks, Jonathan
 
G

Guest

Colin said:
Hi Jonathan,

Try ";pwd=hello" i.e. you need a ";" before the "pwd="

Hi Colin, unfortunitely this line fails with and without the semi-colon prefix

Many thanks, Jonathan
 
G

Guest

Hi Jonathan,

You do need the semi-colon but you also need to fill in the missing
parameters...the first one is True or False for open exclusive mode and the
second is True or False for read-only mode. The error message you are getting
without those parameters must be designed to deliberately mislead!! Also if
you put in the parameters but omit the semi-colon you'll probably get RT
error 3151 ODBC--connection to <database path> failed. Helpful messages NOT.
 
G

Guest

Thanks Colin, you're right. Even though online help states that these
parameters are optional, when included the opendatabase method works...

Many thanks, Jonathan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top