Guy-
You need to edit the Connect property of the TableDef object - you can't
mess with MSysObjects. Open the Immediate Window (Ctrl+G) and enter:
?CurrentDb.TableDefs("<your linked table name here>").Connect
That should show you something like:
;DATABASE=C:\My Documents\Databases\database2.mdb
Write a little sub to loop through the TableDefs and reconnect them:
Public Sub FixConnect()
Dim db As DAO.Database, tdf As DAO.TableDef
Set db = CurrentDb
For Each tdf In db.TableDefs
If (tdf.Attributes And dbAttachedTable) Then
tdf.Connect = ";DATABASE=database2.mdb"
tdf.RefreshLink
End IF
Next tdf
Set tdf = Nothing
Set db = Nothing
End Sub
But I'm not sure that will work without a reference to a specific path. Try
it and let me know how it works out.
John Viescas, author
"Building Microsoft Access Applications"
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Guy Harley
Sent: Tuesday, December 20, 2005 8:30 PM
To: [email protected]
Subject: [ms_access] Linked Tables
I have 2 databases - one has links to tables in the other database. MS
Access records the filename of the second table as an absolute path (e.g.
C:\My Documents\Databases\database2.mdb). Because I am uploading the
databases to the web, I need to record the filename as a relative path (i.e.
just database2.mdb because they are in the same directory). The data is
contained in the column "Databases" in MSysObjects but if I try to edit this
I get the message "Control can't be edited; it's bound to replication system
column 'Database'." The first database is not replicated although the second
is a replica.
Any suggestions, please?
Guy Harley
[Non-text portions of this message have been removed]
Yahoo! Groups Links
------------------------ Yahoo! Groups Sponsor --------------------~-->
1.2 million kids a year are victims of human trafficking. Stop slavery.
http://us.click.yahoo.com/.QUssC/izNLAA/TtwFAA/q7folB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ms_access/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/