Home > Software engineering >  [SOLVED]MySQL connection gets "Run-time error -2147467259 (80004005)" on vb6 but works on
[SOLVED]MySQL connection gets "Run-time error -2147467259 (80004005)" on vb6 but works on

Time:01-16

I'm having an instance MySQL database that hosted on AWS RDS. I was trying to connect to database using ADODB connection on VBA. It worked but when I used the same code on VB6, it gets "Run-time error -2147467259 (80004005)". I tried to change the driver but it has no change.

Here is my code that worked on VBA but got error on VB6 project (I just copied and pasted it):

Set cnn = New ADODB.Connection

cnn.ConnectionString = "DRIVER={MySQL ODBC 8.0 Unicode Driver};" & _
            ";Server=myserver.rds.amazonaws.com" & _
            ";Database=UserManage" & _
            ";Uid=admin" & _
            ";Pwd=mypassword"`

P/s: I'm using MySQL connector 8.0 to connect to the database. My MySQL server and MySQL Workbench version is 8.0.31

CodePudding user response:

I've found the problem on my own, so i'm going to show how I solved it. My MySQL Driver that I used to connect to database is MySQL Connector 8.0(64bit). It worked well on VBA because my Excel application is 64bit. But my running vB6 application is 32 bit, so it caused an error call [mismatch between driver and application]. To solve this issue, I downloaded the 32bit version of MySQL Connector. And that's all, things are done.

I hope this answer helps you guys who have the same issue. Good luck!!

  • Related