"db.TableDefs.Append mytable" causes error

perlfan

Registered User.
Local time
Today, 02:49
Joined
May 26, 2009
Messages
192
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
 

Users who are viewing this thread

Back
Top Bottom