hi there, i have a form in Vb6 and a msacess 2007 database connected using ADODC, on a form is a listbox that i want to populate with the table data from the database, the name of the database is Storenw and the table from which i want to access is sales with fields barcode,item and price. i have the following code in my form-load seem to be working because am not getting any error but in the listbox is showing nothing,.. what can i do? am new in this pls!
Private Sub Form_Load()
Dim rs As New ADODB.Recordset
Dim strConnectionString As String
Dim strSQL As String
On Error GoTo Handler:
strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=C:\Documents and Settings\Mateuss\My Documents\project\storenw.mdb;Persist Security Info=False"
strSQL = "select * from sales"
rs.Open strSQL, strConnectionString
If Not (rs.EOF And rs.BOF) Then
Do While Not rs.EOF
barcode = rs.Fields(0).Value
item = rs.Fields(1).Value
price = rs.Fields(2).Value
Call AddToListBox(barcode, item, price)
MsgBox "Nothing found."
On Error Resume Next
Set rs = Nothing
MsgBox "Error " & Err.Number & ": " & Err.Description
Private Sub AddToListBox(ByVal barcode As String, ByVal item As String, ByVal price As String)