2013-02-13 71 views
1

由於某些技術原因,我不得不將數據庫從sql server更改爲MySQL。 但我收到以下錯誤,我無法連接到數據庫..!「數據源名稱未找到,沒有指定默認驅動程序」連接mysql

Microsoft OLE DB提供程序的ODBC驅動程序錯誤 '80004005'

[微軟] [ODBC驅動程序管理器]數據源名稱未找到,沒有 指定默認驅動程序

Set ObjConn = CreateObject("ADODB.Connection") 
ObjConn.Open ("DRIVER={MySQL ODBC 5.0.96 Driver};SERVER=68.128.172.38;DATABASE=xxx;UID=xxx;PWD=xxx") 

回答

1

這裏你拿着一個樣本連接字符串

Server_Name = "localhost" 'connect to the local remort database server 

databseName = "db" 'database name 
mySQLUser = "root" 'user name 
mysqlPassword = "admin" 'passwrd of the db user 

ConStr= "Driver={MySQL ODBC 5.1 Driver};SERVER=" & Server_Name & ";DATABASE=" & databseName & ";UID=" & mySQLUser & ";PWD=" & mysqlPassword & ";PORT=3306;OPTION=67108864;" ' Connection string 

如果不起作用,請嘗試安裝針對mysql的相關連接器Select and download the connector

相關問題