So Im trying to populate the listbox using string connection and having this error: "the object you entered is not a valid recordset property"
here's the code:
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Set cnn = New ADODB.Connection
cnn = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=xxx;DATABASE=xxx;Port=xxx;USER=xxx; PASSWORD=xx;OPTION=3;"
cnn.Open
Set rst = cnn.Execute("SELECT date, timein, timeout FROM table")
Me.List5.RowSourceType = "Table/Query"
Set Me.List5.Recordset = rst
rst.Close
cnn.Close
Set rst = Nothing
Set cnn = Nothing
Where is the error??? am doing right or is there any better way to populate listbox from string connection.
Thanks a lot...