Re: opening an Access 2000 DB using ODBC...

From: Ralph (msnews.20.nt_consulting32_at_spamgourmet.com)
Date: 11/20/04


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



Relevant Pages

  • ODBC driver crashing my program
    ... I am new to any database stuff. ... Starting the ODBC control panel i can add a User DSN ... if I try to add a new File DSN for the MySQL ODBC ... bug in the MySQL ODBC driver? ...
    (microsoft.public.vc.mfc)
  • Re: Nameless CREATE
    ... The starting point is either an existing database or one that is ... "Describe" involves issuing an SQLDescribeCol function to ODBC ... essentially much the same as character data type apart from all 8 bits ... ALTER TABLE tablename ADD COLUMN BinaryColumn BINARY ...
    (comp.lang.forth)
  • Re: fields queries and utter disaster
    ... Unfortunately the \c ODBC DATABASE field switch is not supported in Word ... of course supports ODBC connections but Word ... Mac Word Test ... suggests that it should be possible to use query files (cf. .qry/.dqy ...
    (microsoft.public.mac.office.word)
  • Re: [VW 7.3.1] ODBCConnection
    ... I played around with a few combinations on the connection string and ... with a trusted SQL Server connection. ... there are differences for database connects. ... > any database specific odbc drivers. ...
    (comp.lang.smalltalk)
  • Re: Serious Problem with Date in RecordSource
    ... Yes, this is ODBC data, not JET data, so some if the things I suggested ... >> c): Decompile the database. ... Still in the code window, choose Compile from the Debug menu. ... rather than allenbrowne at mvps dot org. ...
    (microsoft.public.access.formscoding)

Loading