DBEngine.RegisterDatabase "pcr", "MySQL ODBC 3.51 Driver", True, attribs
***I'm linking the tables using Database and Tabledefs objects.
Public Function link_table(ByVal tblName As String)
Dim count As Integer
Dim sConnString As String
Dim uid As String
'more new code
Dim currentDatabase As Database
Dim myTableDef As TableDef
Set currentDatabase = DBEngine.Workspaces(0).OpenDatabase("\\Esi-sum-program\c-17 edl\Databases\PCR\MySQL_PCR6-29-04-conn.mdb")
On Error GoTo err
'A loop to insert the table, loops up to 3 times if it fails
Do While (Not (check_table(tblName) Or count >= 3))
'new code below
Set myTableDef = currentDatabase.CreateTableDef(tblName)
myTableDef.Connect = "odbc;DATABASE=pcr;UID=" & uid & ";PWD=" & Module1.mypwd & ";DSN=pcr"
myTableDef.SourceTableName = tblName
count = count + 1
***I have been having a problem where the linked tables do not get refreshed. I can add several new records from the frontend and it will work fine. Then for instance I can add a few more records and they will not appear in the list of current records. I have search msdn for similar problems but have found none. If anyone has any helpful insight it would be much appriciated.