Skip to main content
Participating Frequently
March 1, 2007
Answered

Recordset syntax

  • March 1, 2007
  • 14 replies
  • 862 views
Hi there. I'm having some problems with the proper syntax for retrieving a recordset.

the normal call dreamweaver generates: <%= (rsOrder.Fields.Item("UserEmail").Value) %>

however I'm looping through an array where the field is represented by a variable. My question is what would the proper syntax be to accomplish this?

thanx ahead of time
This topic has been closed for replies.
Correct answer Creativ_Technologies
I believe the error is happening with the use of the replace function in your select statement. For example Replace(rsOrder__filterField, "'", "''"); this would be the results

before replace: "ID"
after replace: ""ID""

I think you may be adding too many quotations, you don't need quotations around your column names in your select statement. Also, your filter fields needs to equal something. It doesn't look like your filter fields are being compared to anything. Therefore you have too few parameters.

Make sure you only use the replace function when you actaully need to replace something.

14 replies

NetCompAuthor
Participating Frequently
March 1, 2007
arrHeadings comes from:

If (Request.Form("SelectFields") <> "") Then
rsOrder__selectField = cstr(Request.Form("SelectFields"))
arrHeadings = split(rsOrder__selectField,",")
End If

the array is definitely populated as I can write it out on its own. thats why I'm thinking that my syntax is off.
Inspiring
March 1, 2007
I am assuming you dim arrHeadings as an array. Well arrHeadings is just an array variable it is not contained in the recordset, so the syntax you are using won't work. Have you populated the arrHeadings array yet? if not what are you trying to populate it with?
NetCompAuthor
Participating Frequently
March 1, 2007
thanx for the quick reply. this is what I'd like to do:

<% For i=0 to uBound(arrHeadings) %>
<td align="center"><%= (rsOrder.Fields.Item(cstr(arrHeadings(i))).Value) %></td>
<% Next %>
Inspiring
March 1, 2007
Could you please clarify what you are trying to do? I am not quite understanding. And could you post your loop code?