Connecting to an Access file with an ADODB connection object 
Author Message
 Connecting to an Access file with an ADODB connection object

I don't know why this is giving me so much trouble.  It's probably because
I've gotten soft by just using DSN's for connecting to databases rather than
doing it directly.

All I'm trying to do is create an ADODB.Connection object and open a
connection with a login and password to an Access .mdb file sitting on my
hard drive.  I can't find the docs as to what keys in the
"key=xxx;key2=xxx;" connection string I need to use to do this, and it's
frustrating the heck out of me because I know it's supposed to be a simple
thing to do.

Could one of you experts throw me a bone and fill in the blank for me?

Set gCn = New ADODB.Connection
gCn.Open "what-the-heck-goes-in-here?"



Mon, 28 Jun 2004 05:04:07 GMT
 Connecting to an Access file with an ADODB connection object

Hi!

Try something like this:

gCn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
      "Data Source=C:\Program Files\Microsoft Office\" & _
      "Office\Samples\Northwind.mdb;uid=;pwd=;"

See also documentation for ConnectionString.

Regards
Janne Kejo

Quote:
>-----Original Message-----
>I don't know why this is giving me so much trouble.  It's
probably because
>I've gotten soft by just using DSN's for connecting to

databases rather than
Quote:
>doing it directly.

>All I'm trying to do is create an ADODB.Connection object
and open a
>connection with a login and password to an Access .mdb
file sitting on my
>hard drive.  I can't find the docs as to what keys in the
>"key=xxx;key2=xxx;" connection string I need to use to do
this, and it's
>frustrating the heck out of me because I know it's

supposed to be a simple
Quote:
>thing to do.

>Could one of you experts throw me a bone and fill in the
blank for me?

>Set gCn = New ADODB.Connection
>gCn.Open "what-the-heck-goes-in-here?"

>.



Mon, 28 Jun 2004 20:46:32 GMT
 Connecting to an Access file with an ADODB connection object
You can refer to this KB article:

HOWTO: Open a Secured Access Database in ADO Through OLE DB (Q191754)
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q191754

Luke

(This posting is provided "AS IS", with no warranties, and confers no
rights.)



Tue, 29 Jun 2004 15:28:02 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Trying to connect to sql server thru ADODB.Connection from asp file

2. Question about ADODB.Connection object...

3. ADODB.Command Connection Error in MTS object

4. ADODB.Command Connection Error in MTS object

5. Determining if an ADODB Connection Object is still alive

6. Marshalled ADODB.Connection object causes error

7. Can ADODB.Connection object be passed between layers?

8. Passing ADODB.Connection object

9. Can ADODB.Connection object be passed between layers?

10. Handling multiple asynchronous ADODB.Connection objects

11. Inheriting ADODB.Connection object.

12. ADODB Connection Object using transactions


 
Powered by phpBB® Forum Software