[英]Connecting vb6 to mysql :[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
I am trying to connect vb6 to mysql using xampp but I always get: 我试图使用xampp将vb6连接到mysql,但我总是得到:
"[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified."
“找不到[Microsoft] [ODBC驱动程序管理器]数据源名称,也未指定默认驱动程序。
This is my code: 这是我的代码:
Private Sub class_initialize()
DoEvents
Set con = New ADODB.Connection
With con
.ConnectionString = "Driver=(MySQL ODBC 3.51 Driver); SERVER = localhost; PWD=; UID=root; PORT=3306; DATABASE=mydb;"
.CursorLocation = adUseClient
.Open
End With
End Sub
I already installed mysql 3.51 driver and even the latest 5.3 driver and every time I test this connection it turns successful. 我已经安装了mysql 3.51驱动程序,甚至是最新的5.3驱动程序,每次测试此连接都会成功。 But still getting this error.
但是仍然出现此错误。
I also added this drivers into my System DSN in both ODBC Data Sources (64-bit) and ODBC Data Sources (32-bit) but still no luck. 我还将此驱动程序添加到ODBC数据源(64位)和ODBC数据源(32位)中的System DSN中,但是还是没有运气。
Any other solution? 还有其他解决方案吗?
Thanks 谢谢
Case Closed. 结案。 I just removed the parenthesis on driver.
我只是删除了驱动程序上的括号。
I wasted my time searching for solution. 我浪费时间寻找解决方案。 Never thought of it before posting because I just followed the video tutorial where in his driver name is inside of a parenthesis which worked perfectly.
在发布之前从未考虑过它,因为我只是按照视频教程进行操作,在该视频教程中,他的驱动程序名称位于括号内,该括号非常有效。 Haist.
Haist。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.