ShwethaDoss
Programmer
Hi!
I am trying to connect to a Access 2000 database. This is VB code ,which i have wriiten . I have to display the fields of the database in a combo box . Can you help me in debugging this ? Also , can u suggest some sites, which has information as to how to connect to a database.
Thanks in advance ,
Shwetha
Private Sub Form_Load()
Set db = New Connection
Set rs = New Recordset
db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data source= C:\Projects\MSAccess\db1.mdb"
rs.Open "select Field from Table"
If rs.RecordCount > 0 Then
rs.MoveFirst
While Not rs.EOF
Combo1.AddItem (rs.Fields(0))
rs.MoveNext
Wend
End If
End Sub
I am trying to connect to a Access 2000 database. This is VB code ,which i have wriiten . I have to display the fields of the database in a combo box . Can you help me in debugging this ? Also , can u suggest some sites, which has information as to how to connect to a database.
Thanks in advance ,
Shwetha
Private Sub Form_Load()
Set db = New Connection
Set rs = New Recordset
db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data source= C:\Projects\MSAccess\db1.mdb"
rs.Open "select Field from Table"
If rs.RecordCount > 0 Then
rs.MoveFirst
While Not rs.EOF
Combo1.AddItem (rs.Fields(0))
rs.MoveNext
Wend
End If
End Sub