I am using vb6 and sql server 2000.
I am trying to put results from a query into a listbox when the form loads.
Here is my code:
I need to link the query results to listbox1.text???
Dim emplRS As New Adodb.Recordset
' sets the connection
Const connectStr = "Provider=SQLOLEDB.1;Data Source=MA0;database=ma00_app;uid=gsha;pwd=15;"
' set property to automatically create a connection
emplRS.ActiveConnection = connectStr
' open recordset with query for all records matching variable
emplRS.Open "select whsekey From timwarehouse where companyid = 'QCC' and whseid = '380'"
empirs.Close
my brain is not working, how do i link the query results to listbox1.text?
Thanks


Reply With Quote
