dwe0608
asked on
URGENT : Getrows with Fieldnames
Hi all
I need to get fieldnames and values into an array so I can cycle through them - I know I can get the recordset values into an array using GetRows
dim arr()
arr = rs.getrows(rs.recordcount)
But that doesnt get the field names. What I would like to do is get the fieldname, and the fieldvalue, and place it into an array which I can reference in a for ... next statement getting the fieldname and value at the same time
I am not very good with arrays so commented coded answers would be appreciated
MTIA
Darrin
I need to get fieldnames and values into an array so I can cycle through them - I know I can get the recordset values into an array using GetRows
dim arr()
arr = rs.getrows(rs.recordcount)
But that doesnt get the field names. What I would like to do is get the fieldname, and the fieldvalue, and place it into an array which I can reference in a for ... next statement getting the fieldname and value at the same time
I am not very good with arrays so commented coded answers would be appreciated
MTIA
Darrin
So, no help required!
ASKER
DanRollins - I answered my own question - please set to zero points and leave in tact for others to view (I couldnt find an answer on this topic)
MTIA
Darrin
MTIA
Darrin
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dim vFieldNames()
Dim i
i = 0
ReDim vFieldNames(rs.Fields.Coun
For i = 0 To rs.Fields.Count - 1
arr(i, 0) = rs.Fields(i).Name
arr(i, 1) = rs.Fields(i).Value
Next i