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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop thru fields in a recordset

Status
Not open for further replies.

GBGH

Programmer
Sep 25, 2001
4
US
Hi,

For each row of a recordset (based on a query), I need to loop through the fields and concatenate field values with delimiters for export into a text file. I can't use transfertext b/c different delimiters for last field.

Can one programmatically supply the field name to get the value of the field?

Gretchen

 
the following pseduo code should help you out:

' Move through all the records
rs.movefirst
Do until rs.eof
' loop through each field in the recordset
For i = 0 to (number of fields - 1, since field counts start at zero)
rs.fields(i) ' do whetever
Next i
Loop

****************************
When the human body encounters disease it raises its temperature making it uncomfortable not only for the body but also for the disease. So it global warming the Earth's way of saying we are not wanted?

Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top