A
Andym
Hello,
We are currently moving from dao to ado. We are wondering how to reattach
SQL tables we have linked to an access database using ado instead of dao.
We have to relink because, the server which we attach too is determined by
the user.
This is the current code we are currently using and need changed.
Dim mydb As Database
Dim TmpTable As TableDef
Dim intCountRecs As Integer
Dim intCount As Integer
intCountRecs = mydb.TableDefs.Count
For intCount = 0 To mydb.TableDefs.Count - 1
Set TmpTable = mydb.TableDefs(intCount)
If Len(TmpTable.Connect) > 0 Then
If left(TmpTable.Connect, 4) = "ODBC" Then
TmpTable.Connect = "ODBC;DSN=SERVER"
TmpTable.RefreshLink
End If
End If
Next
Thanks in advance,
Andy
We are currently moving from dao to ado. We are wondering how to reattach
SQL tables we have linked to an access database using ado instead of dao.
We have to relink because, the server which we attach too is determined by
the user.
This is the current code we are currently using and need changed.
Dim mydb As Database
Dim TmpTable As TableDef
Dim intCountRecs As Integer
Dim intCount As Integer
intCountRecs = mydb.TableDefs.Count
For intCount = 0 To mydb.TableDefs.Count - 1
Set TmpTable = mydb.TableDefs(intCount)
If Len(TmpTable.Connect) > 0 Then
If left(TmpTable.Connect, 4) = "ODBC" Then
TmpTable.Connect = "ODBC;DSN=SERVER"
TmpTable.RefreshLink
End If
End If
Next
Thanks in advance,
Andy