Linking to external databases on startup

M

MarkFrost39

I have a database that has tables that are likned to a SQL database via a
ODBC driver.

The problem is that each time I open the database I have to manually go
through File --> Get External Data --> Link Tables --> Select 'ODBC
Databases' --> Then select the connection in 'File Data Sources' --> Type in
my Password --> Then select a database and click 'Ok'.
I don't actually need to select any of the SQL databases at this point, but
unless I do this the other linked tables in the database won't link to the
SQL database.

I am sure that there must be an easier way than this to connect to the SQL
database. I would be great if I could open my database and I am prompted for
the password to connect to the SQL database.
 
P

Pieter Wijnen

A Simple solution is:

Create a simple Passthrough query & store all relevant connection info
there.
Open a Recordset on this Query in your startup code

HTH

Pieter
 
L

Larry Daugherty

google these Access newsgroups - this one in particular, on key
elements: ODBC, SQL, linking via vba, etc.

You should get several hits, several of them will either have or point
you to the required code to do the job.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top