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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server call performance

Status
Not open for further replies.

Layton

Programmer
Nov 29, 2001
15
US
I'd like some expert opinions on the performance difference between these three ways of writing code.
Because of the extra calls to the server would there be a noticable speed difference or not?

I use #1 but we have a programmer that uses #2. His programs run real slow and I was wondering if all the calls to the server is part of the problem.

I also see where #3 is probably faster yet though I haven't ever wrote that way.

Thanks for your help.



#1.

<%
If Not objRs.EOF And Not objRs.BOF Then
While not objRs.Eof %>
<TR><TD><%= objRs.Fields(1).value %></TD></TR>
<TR><TD><%= objRs.Fields(2).value %></TD></TR>
<TR><TD><%= objRs.Fields(3).value %></TD></TR>
<TR><TD><%= objRs.Fields(4).value %></TD></TR>

<% obRs.moveNext
Wend
else
...



#2.

<% If Not objRs.EOF And Not objRs.BOF Then %>
<%While not objRs.Eof %>
<TR><TD><%= objRs.Fields(1).value %></TD></TR>
<TR><TD><%= objRs.Fields(2).value %></TD></TR>
<TR><TD><%= objRs.Fields(3).value %></TD></TR>
<TR><TD><%= objRs.Fields(4).value %></TD></TR>

<% obRs.moveNext%>
<%Wend%>
<%else%>
...


#3.

<%
If Not objRs.EOF And Not objRs.BOF Then
While not objRs.Eof
Response.Write &quot;<TR><TD>&quot; & objRs.Fields(1).value & &quot;</TD></TR>&quot; & vbcrlf & _
&quot;<TR><TD>&quot; & objRs.Fields(2).value & &quot;</TD></TR>&quot; & vbcrlf & _
&quot;<TR><TD>&quot; & objRs.Fields(3).value & &quot;</TD></TR>&quot; & vbcrlf & _
&quot;<TR><TD>&quot; & objRs.Fields(4).value & &quot;</TD></TR>&quot; & vbcrlf

objRs.moveNext
Wend
else
...



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top