Linking tables.

  • Thread starter Thread starter Guest
  • Start date Start date
Hello,

I link tables in one .mdb file from another .mdb file. With the "Linked
Table Manager" I can see that the path to the linked .mdb file is hardcoded.
So if I move the file, the links are broken.

Is there a way to link without hardcoded paths? I have both .mdb always in
the same directory.

If not, how do I change the paths of linked tables programmaticly?
- Open linked table structure.
- Change path.
- Save linked table structure.

Is this possible in any way?

Thanks.
 
An alternative or adjustment to that

IF the FE is in a different directory is to:

1) Create local table in the FE that has in it the directory name of
where the BE mdb files are located.

2) modify the code to included a dlookup from that table to get the
directory name, and then the rest of the process would be the same.

I suggest this because many times the FE is on the local computer
harddrive and so the directory will NOT be the same as the directory of
the BE.

Ron
 
Great thanks.

I do this now:

For Each objTable In .Tables
If UCase(objTable.Type) = "LINK" Then
Rem (6) = Jet OLEDB:Link Datasource.
objTable.Properties.Item(6) = gstrDatabaseDirectory &
gstrDatabaseFile
End If
Next
.Tables.Refresh

I just hope that the two constants "LINK" and "6" never change in Access...
 
Back
Top