0
votes

I am trying to connect vb6 to mysql using xampp but I always get:

"[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified."

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. 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.

Any other solution?

Thanks

1

1 Answers

0
votes

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.