Question:
Using MS access how to get the data into the list box using ADODC in VB 6?
anonymous
2008-01-08 07:42:11 UTC
i tried to access the database using list box but no data could be seen but if i try to access it through the text box or rich text box it works. Is there any additional code to be added to the list box.
Four answers:
KaptKos
2008-01-08 07:49:42 UTC
You need to run a loop to populate each listItem

ie:



for (i = 1 to count of records)

listbox.selecteditem[i].text = ....

next i



something on that line.



in .net you just assign the ddbox to a sqlcommand control
anonymous
2008-01-08 08:07:47 UTC
I believe if your making a connection to the database and this is a static table then you can set the recordset properties to the listbox control. If this is a custom list then you need to write a SQL statement and then set the recordset to the executed SQL statement.



That should help.
anonymous
2008-01-08 07:49:25 UTC
If you could post the sniipet of code you are referring to, it would help alot. Most likely, you are not accessing the items in the listbox properly, but it's hard to say without seeing the code.
Erika
2016-10-22 09:16:45 UTC
To ultimate of my understanding, having ODBC motive force for MS get admission to could desire to be good sufficient, the two at the same time as progression besides as end consumer area. attempt some r&d code on device the place there is only get admission to ODBC motive force is put in, no longer complete get admission to application.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...