Connecting Ms Access Db to Mysql through Vba -
i have been trying connect mysql database
ms access
no result.i don't think using dao.connection
, workspace
properly. keep on getting 3001 connection error when set mysqlcon
. guess arguments not set following example here.
function connectingmysql() dim mysqlcon dao.connection dim wrkodbc workspace set wrkodbc = createworkspace("newodbcworkspace", "admin", "", dbuseodbc) set mysqlcon = wrkodbc.openconnection("connection1", , , "driver={mysql odbc 5.1 driver};" _ & "server=testserver.com;port=3306;" _ & "database=test;" _ & "user=root;" _ & "password=pass;" _ & "option=3;") end function
more infos:
- running ms access 2003
this msdn page says using dbuseodbc
cause runtime error.
odbcdirect workspaces not supported in microsoft access 2010. setting type argument dbuseodbc result in run-time error. use ado if want access external data sources without using microsoft access database engine.
try set wrkodbc = createworkspace("newodbcworkspace", "admin", "")
Comments
Post a Comment