isischen
asked on
syntax of ADODB.recordset's UPDATE with variable used in FIELD and VALUE argument?
I want to use ADODB.RECORDSET 's UPDATE method but I need to use variable in the FIELDS AND VALUES argument.
'recordset.update fields,values
'recordset.update fields,values
Dim strFile As String
Dim varValue As Variant
'set your field and value variables ...
'then pass them in like this ...
rst.Fields(strField).Value = varValue
rst.Update
Steve
Dim varValue As Variant
'set your field and value variables ...
'then pass them in like this ...
rst.Fields(strField).Value
rst.Update
Steve
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
recordset.fields("field").
...
recordset.update
and adodb will generate and run the sql for you.
if fields and values are 2 collections/array/... you "just" need to loop through them and make the line to assign the value "dynamic"...