Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List all the fields of an ADO in a Listbox

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am creating an application where in there are 6 tables at the back-end. Now, i want the users to generate customized reports for themselves. For this I want to allow them to pick their own fields from all the tables and make a report. I want to list all the fields available in different list boxes. But how do i add the fields in the list boxes. I have used ADO control. I tried the following-
For Counter = 1 to adoabc.recordset.fields.count
lstxyz.additem adoabc.recordset.fields.???????
next counter
now what do i put in place of "?". Also, is there any other way i can take care of this problem?
A hint on the same will be appreciated.
thanks
 
here's the solution:

For i = 0 to rstRecordset.Fields.Count - 1
lstList.AddItem rstRecordset.Fields(i).name
next i

Hope that helped.

--Michael P. Gerety
 
Hi try to assign the recordset object to a variable to see what options you have....

Public rs As ADODB.Recordset
Set rs = New ADODB.Recordset

krkX
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top