Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

related to- alternating row colors

Status
Not open for further replies.

mcpeekj

Vendor
Sep 21, 2001
105
can someone tell me why this code

Response.Write &quot;Showing <b>&quot; & rs.RecordCount & &quot;</b> Cars/Vans sorted by <b>&quot; & SortBy & &quot;</b>.<br><br>&quot; & vbcrlf
While Not rs.EOF
dim intRow
for intRow = 1 to rs.recordcount
if (intRow mod 2) = 0 then
response.write(&quot;<TR bgcolor=white>&quot;)
else
response.write(&quot;<TR bgcolor=silver>&quot;)
end if
response.write rs(&quot;Year&quot;)
next
wend
rs.Close
Set rs = Nothing


is causing this error

The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.

?
 
mcpeekj,

dim intRow
introw = 0
Do while NOT rs.EOF
introw = introw + 1
if (intRow mod 2) = 0 then
response.write(&quot;<TR bgcolor=white>&quot;)
else
response.write(&quot;<TR bgcolor=silver>&quot;)
end if
response.write rs(&quot;Year&quot;)
rs.movenext
Loop


fengshui_1998
 
Because you use FOR in the WHILE loop and don't even move to the next record which causes infinite loop.
 
ok, so that works for listing the year and alternated colors, but i actually have 6 things i need listed on each line. when i tried adding more fields (below), it put the Make UNDER year, rather than next to it. what am i doing wrong?

response.write &quot;<table>&quot;
response.write &quot;<tr><td width=50>&quot;
dim intRow
introw = 0
Do while NOT rs.EOF
introw = introw + 1
if (intRow mod 2) = 0 then
response.write(&quot;<TR bgcolor=white>&quot;)
else
response.write(&quot;<TR bgcolor=silver>&quot;)
end if
response.write rs(&quot;Year&quot;)
response.write &quot;</td><td width=100>&quot;
response.write rs(&quot;Make&quot;)
response.write &quot;</td></tr>&quot;
rs.movenext
Loop
 
It's an invalid HTML syntax. Open a <TD> tag after every <TR>.

Do while NOT rs.EOF
introw = introw + 1
if (intRow mod 2) = 0 then
response.write(&quot;<TR bgcolor=white>&quot;)
else
response.write(&quot;<TR bgcolor=silver>&quot;)
end if
response.write &quot;<td width=100>&quot; '' **** ADDED LINE ****
response.write rs(&quot;Year&quot;)
response.write &quot;</td><td width=100>&quot;)&quot;
response.write rs(&quot;Make&quot;)
response.write &quot;</td></tr>&quot;
rs.movenext
Loop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top