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

? Count no.of Fields in a Recordset

Status
Not open for further replies.

suel

Programmer
May 9, 2002
13
GB
I am using VB front-end with SQL2000 DB.
I have retrieved a recordset (ADODB), I am stepping thru' each record in the recordset using .movenext, but I need also to move thru' each field in each record.

Is there some way to do a 'fieldcount' to make a loop ??
example
FOR liErr = 1 to Fieldcount

Next

Regards

Suel

 
Yes:

--------------------------------
dim i as long
for i = 0 to rst.Fields.Count-1
debug.print Rst.fields(i)
next
-------------------------------- Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Thanks ...
I think I was trying to make things harder than it actually is !!!!
Thanks again

Suel
 
You could also do
Dim fld AS ADODB.Field

for each fld in rs.Fields

next

and just refrence the field objects through the fld instance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top