I got some problems to read binary data when I wish to import data from MySQL by using excel-vba. There is only one column in Table, and the data type is binary. Following is my code
Private Sub DataUpdate()
Dim oConn As ADODB.Connection
Dim myRS As ADODB.Recordset
Dim mySQL As String
Dim LastR As Long
Set oConn = New ADODB.Connection
Set myRS = New ADODB.Recordset
oConn.Open "DRIVER={MySQL ODBC 5.2a Driver};" _
& "SERVER=localhost;" & "DATABASE=test;" & "USER=root;" _
& "PASSWORD=XXXXXXX;" & "Option=3"
mySQL = "select * from `test` "
myRS.Open mySQL, oConn
With Worksheets(1)
LastR = .Range("A65536").End(xlUp).Row
Do While Not myRS.EOF
.Cells(LastR + 1, 1) = myRS.Fields(0)
myRS.MoveNext
LastR = LastR + 1
Loop
End With
Set oConn = Nothing
Set myRS = Nothing
End Sub
the result shows nothing but blank. please help me!!