Re: opening an Access 2000 DB using ODBC...
From: Ralph (msnews.20.nt_consulting32_at_spamgourmet.com)
Date: 11/20/04
- Next message: Ralph: "Re: SQL Server does not exist error"
- Previous message: Kevin Yu [MSFT]: "RE: ExecuteNonQuery()"
- In reply to: Brad Pears: "opening an Access 2000 DB using ODBC..."
- Next in thread: Brad Pears: "Re: opening an Access 2000 DB using ODBC..."
- Reply: Brad Pears: "Re: opening an Access 2000 DB using ODBC..."
- Reply: Brad Pears: "Re: opening an Access 2000 DB using ODBC..."
- Reply: Brad Pears: "Re: opening an Access 2000 DB using ODBC..."
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 20 Nov 2004 07:27:37 -0600
"Brad Pears" <donotreply@notreal.com> wrote in message
news:%231S$LLnzEHA.1300@TK2MSFTNGP14.phx.gbl...
> I have an Access 2000 database that I want to open for read only. It uses
a
> system file so I figure the easiest way to open this is to use an ODBC
> connection because in the ODBC driver you can specify the system database
> etc....
>
> Can someone send me the syntax for opening an Access DB using the jet ODBC
> driver?
>
> Also, is there a way to open an Access DB that uses a system DB WITHOUT
> having to use an ODBC driver? If so what would the connection string etc..
> look like?
>
> I want to use DAO not ADO.
>
> Thanks,
>
> Brad
>
The "mother of all" connection string sites. <g>
http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm#ODBCDriverForAccess
You don't have to use the ODBC Data Source Administrator to setup DSN files,
which I think you were referring to in your first paragraph concerning
"system databases". You can always create a 'direct' connection string to
get where you want to go. Take a look at the following (a bit dated, but
still useful) to explain the difference:
http://support.microsoft.com/kb/q165866/
Note the link to difference between 'system', 'user', and 'file' DSNs.
However, to answer you real question - To open a database using DAO and not
ODBC, reference the "Microsoft DAO 3.6 Object Library" and
DBEngine.OpenDatabase, eg ...
Dim db As Database
Dim rs As Recordset
' Open database
Set db = DBEngine.OpenDatabase( _
database_name, False, False, _
"MS Access;PWD=mypassword")
' Create recordset
Set rs = db.OpenRecordset(table_name)
hth
-ralph
- Next message: Ralph: "Re: SQL Server does not exist error"
- Previous message: Kevin Yu [MSFT]: "RE: ExecuteNonQuery()"
- In reply to: Brad Pears: "opening an Access 2000 DB using ODBC..."
- Next in thread: Brad Pears: "Re: opening an Access 2000 DB using ODBC..."
- Reply: Brad Pears: "Re: opening an Access 2000 DB using ODBC..."
- Reply: Brad Pears: "Re: opening an Access 2000 DB using ODBC..."
- Reply: Brad Pears: "Re: opening an Access 2000 DB using ODBC..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|