I am only new in vb 2008 .I Want to populate a combo box in vb 2008 with mysql, but when i run the thing that appear is "System.__ComObject"..kindly check the errors...plz..
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
conn = New ADODB.Connection
rs = New ADODB.Recordset
With conn
.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
& "SERVER=" & MySQL_SVR & ";" _
& "DATABASE=documentdb;" _
& "UID=" & MySQL_UID & ";" _
& "PWD=" & MySQL_PWD & ";" _
& "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384
.CursorLocation = ADODB.CursorLocationEnum.adUseClient
.Open()
.Close()
End With
conn.Open()
query = ("select typeofletter from lettertypes")
rs.Open(query, conn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockBatchOptimistic)
Do While Not rs.EOF
cmbtype.Items.Add(rs.Fields("typeofletter"))
rs.MoveNext()
Loop