dbTalk Databases Forums  

Visual Basic 6 Connection

comp.database.ms-access comp.database.ms-access


Discuss Visual Basic 6 Connection in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Oin Zea
 
Posts: n/a

Default Visual Basic 6 Connection - 01-30-2005 , 06:23 PM






I have been trying to connect to an .mdb file protected by a password
created using Access 2003.

I fond some information on Microsoft DAO Database:

The connect argument is expressed in two parts: the database type, followed
by a semicolon ( and the optional arguments. You must first provide the
database type, such as "ODBC;" or "FoxPro 2.5;". The optional arguments
follow in no particular order, separated by semicolons. One of the
parameters may be the password (if one is assigned). For example:

"FoxPro 2.5; pwd=mypassword"


My Code is:

Set dbsC = OpenDatabase(Path + "\C.mdb",,,"ODBC; pwd=mypassword")

This will result in Run Time Error 3031: Not a valid password

Help Anyone plz!




Reply With Quote
  #2  
Old   
Douglas J. Steele
 
Posts: n/a

Default Re: Visual Basic 6 Connection - 01-31-2005 , 06:20 AM






What the help file fails to mention is that while the 2nd and 3rd parameters
are optional in the OpenDatabase statement, if you leave them out, the 4th
parameter is ignored.

Try

Set dbsC = OpenDatabase(Path + "\C.mdb", False, False, "ODBC;
pwd=mypassword")


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Oin Zea" <OinZea (AT) hotmail (DOT) com> wrote

Quote:
I have been trying to connect to an .mdb file protected by a password
created using Access 2003.

I fond some information on Microsoft DAO Database:

The connect argument is expressed in two parts: the database type,
followed
by a semicolon ( and the optional arguments. You must first provide the
database type, such as "ODBC;" or "FoxPro 2.5;". The optional arguments
follow in no particular order, separated by semicolons. One of the
parameters may be the password (if one is assigned). For example:

"FoxPro 2.5; pwd=mypassword"


My Code is:

Set dbsC = OpenDatabase(Path + "\C.mdb",,,"ODBC; pwd=mypassword")

This will result in Run Time Error 3031: Not a valid password

Help Anyone plz!






Reply With Quote
  #3  
Old   
Oin Zea
 
Posts: n/a

Default Re: Visual Basic 6 Connection - 02-03-2005 , 12:56 AM



Thanks! That did it.
"Douglas J. Steele" <NOSPAM_djsteele (AT) NOSPAM_canada (DOT) com> wrote

Quote:
What the help file fails to mention is that while the 2nd and 3rd
parameters
are optional in the OpenDatabase statement, if you leave them out, the 4th
parameter is ignored.

Try

Set dbsC = OpenDatabase(Path + "\C.mdb", False, False, "ODBC;
pwd=mypassword")


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Oin Zea" <OinZea (AT) hotmail (DOT) com> wrote in message
news:rwgLd.1743$Rj2.558 (AT) fe39 (DOT) usenetserver.com...
I have been trying to connect to an .mdb file protected by a password
created using Access 2003.

I fond some information on Microsoft DAO Database:

The connect argument is expressed in two parts: the database type,
followed
by a semicolon ( and the optional arguments. You must first provide
the
database type, such as "ODBC;" or "FoxPro 2.5;". The optional arguments
follow in no particular order, separated by semicolons. One of the
parameters may be the password (if one is assigned). For example:

"FoxPro 2.5; pwd=mypassword"


My Code is:

Set dbsC = OpenDatabase(Path + "\C.mdb",,,"ODBC; pwd=mypassword")

This will result in Run Time Error 3031: Not a valid password

Help Anyone plz!









Reply With Quote
  #4  
Old   
Oin Zea
 
Posts: n/a

Default Re: Visual Basic 6 Connection - 02-03-2005 , 12:57 AM



Thanks! That did it.

"Douglas J. Steele" <NOSPAM_djsteele (AT) NOSPAM_canada (DOT) com> wrote

Quote:
What the help file fails to mention is that while the 2nd and 3rd
parameters
are optional in the OpenDatabase statement, if you leave them out, the 4th
parameter is ignored.

Try

Set dbsC = OpenDatabase(Path + "\C.mdb", False, False, "ODBC;
pwd=mypassword")


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Oin Zea" <OinZea (AT) hotmail (DOT) com> wrote in message
news:rwgLd.1743$Rj2.558 (AT) fe39 (DOT) usenetserver.com...
I have been trying to connect to an .mdb file protected by a password
created using Access 2003.

I fond some information on Microsoft DAO Database:

The connect argument is expressed in two parts: the database type,
followed
by a semicolon ( and the optional arguments. You must first provide
the
database type, such as "ODBC;" or "FoxPro 2.5;". The optional arguments
follow in no particular order, separated by semicolons. One of the
parameters may be the password (if one is assigned). For example:

"FoxPro 2.5; pwd=mypassword"


My Code is:

Set dbsC = OpenDatabase(Path + "\C.mdb",,,"ODBC; pwd=mypassword")

This will result in Run Time Error 3031: Not a valid password

Help Anyone plz!









Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.