Thanks Colin, you're right. Even though online help states that these
parameters are optional, when included the opendatabase method works...
Many thanks, Jonathan
"Colin" wrote:
> 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.
>
> --
> Colin
>
>
> "Jonathan" wrote:
>
> > "Colin" wrote:
> >
> > > Hi Jonathan,
> > >
> > > Try ";pwd=hello" i.e. you need a ";" before the "pwd="
> > > --
> > > Colin
> >
> > Hi Colin, unfortunitely this line fails with and without the semi-colon prefix
> >
> > Many thanks, Jonathan
> > >
> > > "Jonathan" wrote:
> > >
> > > > 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
|