从 VB6 应用程序连接到 MySQL
我正在尝试从 VB6 应用程序连接到本地 MySQL 数据库。阅读了这个问题中给出的答案后, Connecting VB to MySQL 我已经设置了连接...
Private database_connection As ADODB.Connection
Set database_connection = New ADODB.Connection
database_connection.ConnectionString = _
"Driver={MySQL ODBC 3.51 Driver}; Server=localhost; Database=mydb; " _
" Username=myuser; Password=mypass; Option=3"
database_connection.Open
这给了我一个错误...
(1) Error#: -2147467259
Desc. : [MySQL][ODBC 3.51 Driver]Access denied for user 'ODBC'@'localhost' (using password: YES)
Source: Microsoft OLE DB Provider for ODBC Drivers
Native Error: 1045
SQL State: S1000
Help Context: 0
Help File:
这是正确的方法吗?如果是这样,看来我需要在数据库中为 ODBC 创建一个帐户。是这样吗,还是还有什么地方不对劲?
I am trying to connect to a local MySQL database from a VB6 application. Having read the answer given in this question, Connecting VB to MySQL I have set up my connection thus...
Private database_connection As ADODB.Connection
Set database_connection = New ADODB.Connection
database_connection.ConnectionString = _
"Driver={MySQL ODBC 3.51 Driver}; Server=localhost; Database=mydb; " _
" Username=myuser; Password=mypass; Option=3"
database_connection.Open
This gives me an error...
(1) Error#: -2147467259
Desc. : [MySQL][ODBC 3.51 Driver]Access denied for user 'ODBC'@'localhost' (using password: YES)
Source: Microsoft OLE DB Provider for ODBC Drivers
Native Error: 1045
SQL State: S1000
Help Context: 0
Help File:
Is this the right approach? And if so, it appears I need to create an account in the database for ODBC. Is that the case, or is there something else wrong somewhere?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
User=myuser;
而不是Username=myuser;
Use
User=myuser;
instead ofUsername=myuser;
检查您的用户名/密码以及该用户名是否具有连接数据库的访问权限。
Check your username/password and if that username has accesrights to connect to database.