Link Access Database

  • Thread starter Thread starter Dwaine Horton
  • Start date Start date
D

Dwaine Horton

Hi, I am trying to figure out how to have an Access front end that any user
can use but they need to link another database to this database. I would
like to add code to do the linking as the file with the tables may be saved
in different locations.

Once the databases are linked I then want to do some queries to return a
county based on a city/state/zip code combination.

Basically what I want to do is create an Access file with my coding for this
lookup and then allow the user to link to the Access file that has the tables
with the city-state-zip and county info.
 
This link might be helpful:
http://www.mvps.org/access/tables/tbl0009.htm

Very stripped down, what you would do is set the Connect property of a
tabledef and refresh it:

Dim td as TableDef
Set td = CurrentDb.TableDefs("tablename")
td.Connect = ";DATABASE=C:\Somepath\Somefile.mdb"
td.RefreshLinks
Set td = Nothing


hth
--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
Hi, I am trying to figure out how to have an Access front end that any user
can use but they need to link another database to this database. I would
like to add code to do the linking as the file with the tables may be saved
in different locations.


If you want a more automated approach to relinking tables, you're
welcome to use our free J Street Access Relinker at:
http://www.jstreettech.com/downloads

It handles multiple Access back-end databases, ignores ODBC linked
tables, and can automatically and silently relink to back-end
databases in the same folder as the application (handy for work
databases or single-user scenarios). There's a ReadMe table with
instructions.

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 
Back
Top