>I Have one table that has all the fieldnames listed for all the tables
>
>The FIELDRS is a record set of the fieldnamess in that table
>
>The first for loop converts the recordset into an array
>
>Then what i want the second For loop to do is use that array to insert the fieldnames in the UPDATE Query And Then also use the array to specify the source fields in the same update statement.
>
> For x = 0 to fieldlc
>Create Array ---> field(x) = FIELDRS("FIELDS")
> FIELDSRS.movenext
> Next
>
> For Y = 1 to loopcontrol
> UpdateQuery = "UPDATE " & TableName & " "
> For X = 0 to fieldlc
> UpdateQuery = UpdateQuery & VFPRS.fields(field(x)) & "=" & field(x)
> Next
> UpdateQuery = UpdateQuery & " WHERE PRIMKEY=" & Y
> Response.Write UpdateQuery
> 'connSQL.execute(UpdateQuery)
> VFPRS.movenext
> Next
See the corrections in bold above. This assumes that the looping code and concatenation logic is correct. If it still doesn't work it will help if you post the value of UpdateQuery in your next message.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only