I couldnt connect my vba to the mysql. can you tell me where did I go wrong? this method raise runtime error "[Microsoft][ODBC Driver Manager]Data source name not found and no default driver specified" my OS is win 7 64 bit and I just installed 64bit ODBC Connector from https://downloads.mysql.com/archives/c-odbc/ but still the error occurs. I also use xampp with no password if that is also need specifying.
Sub SqlConnect()
Dim ReturnArray
Dim Conn As New ADODB.Connection
Dim mrs As New ADODB.Recordset
Dim DBPath As String
Dim sconnect As String
DBPath = ThisWorkbook.FullName
sconnect = "DRIVER={MySQL ODBC 5.2.2 Driver}; SERVER = localhost;" & _
"PORT=3306;" & _
"DATABASE= timeintimeoutdb;" & _
"UID=root;" & _
"PWD=;"
Conn.Open sconnect
sqlstring = "SELECT * FROM [students]"
mrs.Open sqlstring, Conn
ActiveSheet.Range("A2").CopyFromRecordset mrs
mrs.Close
Conn.Close
End Sub