mySQL ODBC connection string for 64bit on VB6.0

2019-08-17 16:20发布

问题:

I have a program in visual basic 6.0 that uses MySQL ODBC connection I have installed MySQL ODBC connector 5.2.7 64-bit but when ever i try to connect with my datasource it says

[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application

Is there any way to edit my connection string to work on 64 bit or any other solution to resolve this error? here is my code:

Public Function dbclose()
On Error Resume Next
    ac.Close
    Set ac = Nothing
    ar.Close
    Set ar = Nothing
End Function
Public Sub openDB()
Dim connect As String

connect = "Provider=MSDataShape.1;Persist Security Info=False;Data Source=LSRS;Data Provider=MSDASQL"
strConek = "Provider=MSDataShape.1;Persist Security Info=False;Data Source=LSRS;Data Provider=MSDASQL"

With con
    .Open connect
    .CursorLocation = adUseClient
 End With
End Sub

Public Function dbuser()
Set ac = New ADODB.Connection
Set ar = New ADODB.Recordset
strConek = "Provider=MSDataShape.1;Persist Security Info=False;Data Source=LSRS;Data Provider=MSDASQL"
End Function

Public Function dbconek()
    Set ac = New ADODB.Connection
    Set ar = New ADODB.Recordset
strConek = "Provider=MSDataShape.1;Persist Security Info=False;Data Source=LSRS;Data Provider=MSDASQL"
End Function
标签: mysql vb6