Hi - I am linking the tables of my MySQL database using the code below. The line "db.TableDefs.Append mytable" is causing an error though (triggers the on error event). Does anybody know how I can change the code so the code works without the error? Thanks a lot! FRANK
Code:
Conn.Provider = "MSDASQL"
Conn.Mode = adModeRead
Conn.Open Constr
Conn.CursorLocation = adUseClient
Set RSTSchema = Conn.OpenSchema(adSchemaCatalogs)
cat.ActiveConnection = Conn
For i = 0 To cat.Tables.Count - 1
Set mytable = db.CreateTableDef(cat.Tables(i).Name)
mytable.SourceTableName = cat.Tables(i).Name
mytable.connect = "ODBC;" & Constr & ";Option=3"
db.TableDefs.Append mytable
db.TableDefs.Refresh
Next i