Trying to reprogram my Msaccess 2000 to 2007, time to update.
Using MSSQL 2000 data tables.
When the programs start, I can push a button that allows me to re-connect to either the Real Data or Test Data. A simplified version of the code is as follows:
Public Function ReAttachBuildersTable() As Integer
Dim DB As Database
Dim tdf As TableDef
ReAttachBuildersTable = True
Set DB = CurrentDb()
Set tdf = DB.TableDefs("Builders")
tdf.Connect = "ODBC;DATABASE=JSEdata;UID=SA;PWD=;DSN=JSE_SQL"
tdf.RefreshLink
ReAttachBuildersTable = (Err = 0)
DB.Close
End Function
This has worked for years in Access 2000
I get an error 3151 in Access 2007 at the RefreshLink; eventhough the program can see the table and use it in list boxes and code using recordsets.
The Linked Table Manager works fine. I just cannot RefreshLink using code.
I think I have all the Trusted areas set to yes.
Any ideas?
Using MSSQL 2000 data tables.
When the programs start, I can push a button that allows me to re-connect to either the Real Data or Test Data. A simplified version of the code is as follows:
Public Function ReAttachBuildersTable() As Integer
Dim DB As Database
Dim tdf As TableDef
ReAttachBuildersTable = True
Set DB = CurrentDb()
Set tdf = DB.TableDefs("Builders")
tdf.Connect = "ODBC;DATABASE=JSEdata;UID=SA;PWD=;DSN=JSE_SQL"
tdf.RefreshLink
ReAttachBuildersTable = (Err = 0)
DB.Close
End Function
This has worked for years in Access 2000
I get an error 3151 in Access 2007 at the RefreshLink; eventhough the program can see the table and use it in list boxes and code using recordsets.
The Linked Table Manager works fine. I just cannot RefreshLink using code.
I think I have all the Trusted areas set to yes.
Any ideas?