HI, Im not a vba / access bod, so apologies.
Ive got an access database, that Ive split.
This is going to be installed on a network.
Ive found the code below, which is says will update a table to its new link when called.
Ive created a table in my front end called configuration
So, how do I actually iterate throughthe table, so I can pull out the table names, and the location.
Or
Is there an easier way?
(I assume that as MS allows this to happen, that there may be a config setting or a key somewhere that can be set to the appropriate location?
Cheers
K
Ive got an access database, that Ive split.
This is going to be installed on a network.
Ive found the code below, which is says will update a table to its new link when called.
Ive created a table in my front end called configuration
So, how do I actually iterate throughthe table, so I can pull out the table names, and the location.
Or
Is there an easier way?
(I assume that as MS allows this to happen, that there may be a config setting or a key somewhere that can be set to the appropriate location?
Code:
Sub LinkTable(strTable As String, strDb As String)
Const LT_LINKEDALREADY As Integer = 3012
Dim tdf As TableDef
On Error GoTo Err_LinkTable
'-- Create a new TableDef then link the external table to it
Set tdf = gdbs.CreateTableDef(strTable)
tdf.Connect = ';DATABASE=' & strDb
tdf.SourceTableName = strTable
'-- Add this TableDef to the current database.
gdbs.TableDefs.Append tdf
Exit_LinkTable:
Exit Sub
Err_LinkTable:
If Err.Number = LT_LINKEDALREADY Then
'-- Do nothing - the table's linked in already
Resume Exit_LinkTable
Else
'-- Put some code here to handle this error
End If
End Sub
Cheers
K