N
nik
Hi,
In trying to relink some tables to MySQL ODBC tables with the username
and password fields, I keep ending up with Updatable=False tables,
even though the MySQL tables are Updatable, and if I create the linked
tables manually, they are Updatable.
Here is the basic code (VB2007 and MySQL):
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim dbSQL As DAO.Database
Dim dbLocal As DAO.Database
Dim tdf As DAO.TableDef
Dim sConnect As String
sConnect = "ODBC;Driver={MySQL ODBC 5.1 Driver};" & _
"SERVER=" & mdlConst.sMYSQLSERVERNAME & ";" & _
"PORT=3306;" & _
"DATABASE=" & mdlConst.sMYSQLDATABASENAME & ";" & _
"USER=" & mdlConst.sMySQLUSERNAME & ";" & _
"PASSWORD=" & sPassword ' & ";"
Set dbSQL = DBEngine.OpenDatabase("", False, False, sConnect)
Set dbLocal = CurrentDb()
dbLocal.TableDefs.Delete mdlConst.sLOCALLINKTABLENAME
Set tdf = dbLocal.CreateTableDef(mdlConst.sLOCALLINKTABLENAME, _
dbAttachSavePWD, _
mdlConst.sREMOTELINKTABLENAME, _
sConnect)
dbLocal.TableDefs.Append tdf
dbLocal.TableDefs.Refresh
Set tdf = Nothing
dbSQL.Close
dbLocal.Close
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
All of the tables in dbSQL are Updatable = True
None of the tables that I create using CreateTableDef are Updatable,
and since that property is readonly, I can't change it.
How do I create an Updatable table? An Updatable linked table?
My first attempt to just reset the connect property hit a wall:
http://groups.google.com/group/micr...634c7a0bfe?lnk=gst&q=nikbaer#db64c7634c7a0bfe
Thanks,
Nik
In trying to relink some tables to MySQL ODBC tables with the username
and password fields, I keep ending up with Updatable=False tables,
even though the MySQL tables are Updatable, and if I create the linked
tables manually, they are Updatable.
Here is the basic code (VB2007 and MySQL):
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim dbSQL As DAO.Database
Dim dbLocal As DAO.Database
Dim tdf As DAO.TableDef
Dim sConnect As String
sConnect = "ODBC;Driver={MySQL ODBC 5.1 Driver};" & _
"SERVER=" & mdlConst.sMYSQLSERVERNAME & ";" & _
"PORT=3306;" & _
"DATABASE=" & mdlConst.sMYSQLDATABASENAME & ";" & _
"USER=" & mdlConst.sMySQLUSERNAME & ";" & _
"PASSWORD=" & sPassword ' & ";"
Set dbSQL = DBEngine.OpenDatabase("", False, False, sConnect)
Set dbLocal = CurrentDb()
dbLocal.TableDefs.Delete mdlConst.sLOCALLINKTABLENAME
Set tdf = dbLocal.CreateTableDef(mdlConst.sLOCALLINKTABLENAME, _
dbAttachSavePWD, _
mdlConst.sREMOTELINKTABLENAME, _
sConnect)
dbLocal.TableDefs.Append tdf
dbLocal.TableDefs.Refresh
Set tdf = Nothing
dbSQL.Close
dbLocal.Close
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
All of the tables in dbSQL are Updatable = True
None of the tables that I create using CreateTableDef are Updatable,
and since that property is readonly, I can't change it.
How do I create an Updatable table? An Updatable linked table?
My first attempt to just reset the connect property hit a wall:
http://groups.google.com/group/micr...634c7a0bfe?lnk=gst&q=nikbaer#db64c7634c7a0bfe
Thanks,
Nik