Jump to content

Recordset display and check values problem


dnainby

Recommended Posts

I'm using IIS 6 server 2003 with MySql 5. After creating a Recordset am trying to display some values from that recordset using the the code snippet below. The problem is that only First instance from the conditional statement is being displayed. After the first condition is tested for, the relevant recordset value seems to have been lost.

<div id="testDiv" style="position:absolute; left:750px; top:600px; width:246px; height:38px; z-index:6; visibility: visible;"> <% if ((Recordset1.Fields.Item("Last_Name").Value)="Jones") then%>First Instance<%end if%> <% if ((Recordset1.Fields.Item("Last_Name").Value)="Jones") then%>Second Instance<%end if%> <%=(Recordset1.Fields.Item("Last_Name").Value)%> <%=(Recordset1.Fields.Item("Last_Name").Value)%></div>

Link to comment
Share on other sites

You're saying that you have the same condition and it only succeeds once? That doesn't make sense.Print out the values to see what is happening.

<% if ((Recordset1.Fields.Item("Last_Name").Value)="Jones") then  Response.Write("succeed: " & Recordset1.Fields.Item("Last_Name").Value & "<br>")else  Response.Write("fail: " & Recordset1.Fields.Item("Last_Name").Value & "<br>")end ifif ((Recordset1.Fields.Item("Last_Name").Value)="Jones") then  Response.Write("succeed: " & Recordset1.Fields.Item("Last_Name").Value & "<br>")else  Response.Write("fail: " & Recordset1.Fields.Item("Last_Name").Value & "<br>")end if%>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...