• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • Last Modified:

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

0
dwe0608
Asked:
dwe0608
  • 2
1 Solution
 
dwe0608Author Commented:
ok - I have worked out a way ... using the following code, where rs is a valid recordset object  

    Dim vFieldNames()
    Dim i
    i = 0
    ReDim vFieldNames(rs.Fields.Count, 1)
    For i = 0 To rs.Fields.Count - 1
        arr(i, 0) = rs.Fields(i).Name
        arr(i, 1) = rs.Fields(i).Value
    Next i

0
 
jpaulinoCommented:
So, no help required!
0
 
dwe0608Author Commented:
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
0
 
Computer101Commented:
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now