PC Review


Reply
Thread Tools Rate Thread

>> dao connect with password

 
 
=?Utf-8?B?Sm9uYXRoYW4=?=
Guest
Posts: n/a
 
      2nd Aug 2007
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q29saW4=?=
Guest
Posts: n/a
 
      2nd Aug 2007
Hi Jonathan,

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


"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

 
Reply With Quote
 
=?Utf-8?B?Sm9uYXRoYW4=?=
Guest
Posts: n/a
 
      2nd Aug 2007
"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

 
Reply With Quote
 
=?Utf-8?B?Q29saW4=?=
Guest
Posts: n/a
 
      3rd Aug 2007
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

 
Reply With Quote
 
=?Utf-8?B?Sm9uYXRoYW4=?=
Guest
Posts: n/a
 
      5th Aug 2007
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connect to SQL with DSN without uid and password augustus Microsoft Excel Programming 3 24th Feb 2009 10:41 PM
Vista will not let Save User Password Appear when user name and password required - Connect to screen dvanthull Windows Vista Administration 4 30th Jun 2008 12:31 PM
Can't connect to local machine with anything except IE Other browsers can't connect without password Otis Mukinfus Microsoft ASP .NET 3 8th Jul 2005 05:54 AM
Connect Password Pop Up sarah Windows XP Security 1 12th Sep 2003 09:35 PM
can not connect password larry Windows XP Messenger 0 9th Jul 2003 02:45 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:10 AM.