Forums

This topic is locked

Why cant I use it more than once.

Posted 12 Nov 2002 01:04:44
1
has voted
12 Nov 2002 01:04:44 Head Mr. posted:
if i try to

<%=(Recordset1.Fields.Item("FeaturedBandID".Value)%>

or any other such query, it will only go thru the first time? and idea why?
it wouldnt be a problem except i have a menu that needs to select the current variable when editing.. and none of the selects are going thru except for the first one:

<option value="January" <%If (Recordset1.Fields.Item("FMonth".Value = "January" Then Response.Write("SELECTED" : Response.Write(""%>>January</option>
<option value="Febuary" <%If (Recordset1.Fields.Item("FMonth".Value = "Febuary" Then Response.Write("SELECTED" : Response.Write(""%>>Febuary</option>
<option value="March" <%If (Recordset1.Fields.Item("FMonth".Value = "March" Then Response.Write("SELECTED" : Response.Write(""%>>March</option>
<option value="April" <%If (Recordset1.Fields.Item("FMonth".Value = "April" Then Response.Write("SELECTED" : Response.Write(""%>>April</option>
<option value="May" <%If (Recordset1.Fields.Item("FMonth".Value = "May" Then Response.Write("SELECTED" : Response.Write(""%>>May</option>
<option value="June" <%If (Recordset1.Fields.Item("FMonth".Value = "June" Then Response.Write("SELECTED" : Response.Write(""%>>June</option>


The selected only shows up if it meet's it's JANUARY.

-I am beyond the line of Morality and therefore, beyond caring.

Replies

Replied 12 Nov 2002 01:26:49
12 Nov 2002 01:26:49 Head Mr. replied:
well.. i found a work around, converting it to a variable. but still not the easiest way.


-I am beyond the line of Morality and therefore, beyond caring.
Replied 12 Nov 2002 02:36:09
12 Nov 2002 02:36:09 Owen Eastwick replied:
If you are using a recordset field value on a page more than once it's good practice to store it in a variable. Once stored in a variable it can be referenced quicker and improve the performance of the page. This goes for other Request objects too, Request.QueryString, Request.Form etc.

The horses mouth: msdn.microsoft.com/library/default.asp?url=/library/en-us/dnasp/html/asptips.asp

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo

Reply to this topic