Hi,
There should be a rsdis.movefirst to populate the recordset, I also missed that in my first code - sorry.
---------------------------------------------------------
Dim rsdis As New ADODB.Recordset
Set rsdis = conn.Execute("select * from alldiseases"
If Not (rsdis.EOF And rsdis.BOF) Then
rddis.movefirst
While Not rsdis.EOF
List1.AddItem rsdis!diseasename
rsdis.MoveNext
Wend
End If
----------------------------------------------------------
Here is a piece of code that I use and I know works:
----------------------------------------------------------
Private Sub Command1_Click()
Dim con As ADODB.Connection
Dim rst As Recordset, StrCon As String
StrCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = c:\tmp\test.mdb"
Set con = New ADODB.Connection
con.Open StrCon
Set rst = New ADODB.Recordset
rst.Open "SELECT * FROM TblTest", con, adOpenStatic, adLockOptimistic 'edit the SQL statement here
If Not (rst.EOF And rst.BOF) Then
rst.MoveFirst
While Not rst.EOF
List1.AddItem rst.Fields(0) 'you can replace the '0' with your fieldname
rst.MoveNext
Wend
Else
List1.AddItem "No records in recordset"
End If
rst.Close
Set rst = Nothing
con.Close
Set con = Nothing
End Sub
----------------------------------------------------------
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'