I'm trying to connect to a MySQL server using MyODBC 3.51 and Access. Unfortunately, this doesn't work.

I'm using the DAO code example from http://www.mysql.com/products/myodbc...r_ODBC_With_VB

My code looks like this:
Code:
Dim ws As Workspace
Dim conn As Connection
Dim queryDef As queryDef
Dim str As String
Dim rs As DAO.Recordset

'connect to MySQL using MySQL ODBC 3.51 Driver
Set ws = DBEngine.CreateWorkspace("", "***", "*****", dbUseODBC)

str = "odbc;DRIVER={MySQL ODBC 3.51 Driver};" _
    & "SERVER=*****.nl;DATABASE=jubalvar_database;UID=*****;PWD=****;OPTION=3;"
Using the next line doesn't function at all:

Code:
Set conn = ws.OpenConnection("test", dbDriverNoPrompt, False, str)
When I change this into the next line, a prompt to specify the connection paramaters shows.

Code:
Set conn = ws.OpenConnection("test", dbDriverNoPrompt, False, str)
However, even then it doesn't funtion properly. Using the code below I get only one MessageBox saying "-1". Stated otherwhise: for some reason there are no records found in the specified table.

Code:
Set rs = conn.OpenRecordset("Test")
With rs
    MsgBox (.RecordCount)
    
    For x = 1 To .RecordCount
        MsgBox (!Test)
    Next
End With
Any clue what I do wrong?