R
Rod
I'm trying to create a simplified version of the linked table manager to
refresh or relink tables from a front end app to two different mdb files in
two different locations. I'm trying to use an approach a found where the
TableName and DataFilePath is stored in table tblLinkedTables.
This is the code:
Function RelinkByList() As Integer
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim tdf As DAO.TableDef
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblLinkedTables", dbOpenSnapshot)
' Loop through the recordset, processing rows
Do Until rst.EOF
Set tdf = dbs.TableDefs(rst!TableName)
tdf.Connect = rst!DataFilePath
tdf.RefreshLink
rst.MoveNext
Loop
Set tdf = Nothing
Set rst = Nothing
Set dbs = Nothing
End Function
The code returns an error saying: "Run-time error '3170': Could not find
installable ISAM."
On debug, the line referenced is tdf.RefreshLink.
What am I doing wrong?
Rod
refresh or relink tables from a front end app to two different mdb files in
two different locations. I'm trying to use an approach a found where the
TableName and DataFilePath is stored in table tblLinkedTables.
This is the code:
Function RelinkByList() As Integer
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim tdf As DAO.TableDef
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblLinkedTables", dbOpenSnapshot)
' Loop through the recordset, processing rows
Do Until rst.EOF
Set tdf = dbs.TableDefs(rst!TableName)
tdf.Connect = rst!DataFilePath
tdf.RefreshLink
rst.MoveNext
Loop
Set tdf = Nothing
Set rst = Nothing
Set dbs = Nothing
End Function
The code returns an error saying: "Run-time error '3170': Could not find
installable ISAM."
On debug, the line referenced is tdf.RefreshLink.
What am I doing wrong?
Rod