JT wrote:
> how can i loop through all the fields in a recordset adding a
> collection of name/value pairs to a data dictionary where name is the
> field name and value is the field value. this is what i have so far
> (not working, of course..)
Please define "not working". Error message? Wrong result?
> this is will only be used for one row recordsets.
>
> dim d
> set d = CreateObject("Scripting.Dictionary")
>
> for each field in rsGetData.Fields
> d.Add LCase(field), rsGetData.Fields(field)
> Next
>
This is what I would do:
'disconnect the recordset and close the connection:
set rsGetData.ActiveConnection=nothing
conn.close:set conn = nothing
'now write the dictionary items:
for each fld in rsGetData.Fields
d.Add LCase(fld.name), fld.value
next
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
|