J
JoJoFromCoCoMo
I have a A2K DB with a DB password assigned PW="test" and
I want to relink tables using code. I need help witht he
syntax. I currently have code to work without a password
as follows:
Dim tdf As TableDef
Dim strDBName, strDBTable As String
Set dbsCurrDB = CurrentDb()
Set rst = dbsCurrDB.OpenRecordset("SELECT DISTINCT
LocalTable.DatabaseName, LocalTable.DatabasePath,
LocalTable.TableName FROM LocalTable;", dbOpenSnapshot)
With rst
rst.MoveFirst
For Each tdf In dbsCurrDB.TableDefs
If Not tdf.Name Like "*sys*"
And Not Len(tdf.Connect) = 0 _
And Not tdf.Name Like "LocalMaster" Then
tdf.Connect = ";DATABASE=" & rst!
DatabasePath & rst!DatabaseName
tdf.RefreshLink
End If
Next tdf
I want to relink tables using code. I need help witht he
syntax. I currently have code to work without a password
as follows:
Dim tdf As TableDef
Dim strDBName, strDBTable As String
Set dbsCurrDB = CurrentDb()
Set rst = dbsCurrDB.OpenRecordset("SELECT DISTINCT
LocalTable.DatabaseName, LocalTable.DatabasePath,
LocalTable.TableName FROM LocalTable;", dbOpenSnapshot)
With rst
rst.MoveFirst
For Each tdf In dbsCurrDB.TableDefs
If Not tdf.Name Like "*sys*"
And Not Len(tdf.Connect) = 0 _
And Not tdf.Name Like "LocalMaster" Then
tdf.Connect = ";DATABASE=" & rst!
DatabasePath & rst!DatabaseName
tdf.RefreshLink
End If
Next tdf