Hello. I'm trying to link my Microsoft Access 2003 database to my VB Combobox. I want to get my combobox's list directly from my database so that everytime my database is changed (e.g: added new names or deleted a name), the combobox will be updated automatically.
I tried using
Dim conec As New ADODB.Connection
Dim rs As New ADODB.Recordset
rs.Open "select STUDENTNAME from STUDENTDATA", conec, adOpenKeyset, adLockOptimistic
If rs1.EOF = False Then
Do Until rs1.EOF
Combo1.AddItem rs!KD_SALES
rs.MoveNext
Loop
rs.Close
End If
End Sub
but they arn't working and thus i connected my program using
Dim conec AS New OleDB.OleDBConnection
conec.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = Actual_Database.mdb; Jet OLEDB:Database Password = xxxx"
con.Open( )
con.Close( )
Right now i'm stuck at this point. I'm having problems getting my combobox's list directly from my database. When i tried putting the ADODB.RecordSet, blue wriggly lines appear. Any help would be greatly appreciated.
Cheers,
sowms