Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 23rd, 2006, 10:57 AM
Friend of Wrox
 
Join Date: May 2005
Location: , , .
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default performance issue

Does the following code affect the performance?
This is a memberhsip script.
and for each member I check if he is online or offline?
since it has another recordset(rslog) that will be executed for each record inside the first recordset
if yes is there any other way?


rsFriend.Open "SELECT * friends"
 If NOT (rsFriend.BOF AND rsFriend.EOF) Then
    If CInt(intPage) > CInt(intPageCount) Then intPage = intPageCount
    If CInt(intPage) <= 0 Then intPage = 1
        If intRecordCount > 0 Then
            rsFriend.AbsolutePage = intPage
            intStart = rsFriend.AbsolutePosition
            If CInt(intPage) = CInt(intPageCount) Then
                intFinish = intRecordCount
            Else
                intFinish = intStart + (rsFriend.PageSize - 1)
            End if
        End If


numberOfColumns =5
columnsDone=0
Response.Write "<table><tr>"
If intRecordCount > 0 Then
For intRecord = 1 to rsFriend.PageSize

set rsLog=server.createobject("adodb.recordset")
strSql = "SELECT * FROM cmm_logTime WHERE offline=0 AND userid=" & rsFriend("userID")
    rslog.Open strSQL, conn,3, 3
if not rsLog.eof then
strOnline="y"
else
strOnline="n"
end if
%>

       <TD class=picFrame style="MARGIN: 0px" vAlign=top align=middle><SPAN >
                             <DIV class=head> <A href="profile.asp?uid=<%=rsFriend("userID")%>" >
                <%if rsFriend("userPic") <> "" Then%><IMG alt=<%=rsFriend("firstname")%> src="user_images/<%=rsFriend("UserPic")%>" width=<%=intWidth%> height=<%=intHeight%> border=0>
                <%else%>
                <%if rsFriend("gender")="male" then%>
                <IMG alt=<%=rsFriend("firstname")%> src="user_images/noimage_male.jpg" width=<%=intWidth%> height=<%=intHeight%> border=0>
                <%else%>
                <IMG alt=<%=rsFriend("firstname")%> src="user_images/noimage_female.jpg" width=<%=intWidth%> height=<%=intHeight%> border=0>
                <%end if%>

                <%end if%>
<%=left(rsFriend("firstname"),12)%></SPAN>(<%=rsFriend("Friend_COUNT")%>)</A>
<br><%if strOnline="y" then response.write "Online" else response.write "Offline"%>
</div>
                                </TD>
<%
 columnsDone = columnsDone + 1
    rsFriend.MoveNext

    If columnsDone Mod numberOfColumns = 0 Then
        Response.Write "</tr><tr>"
    End If
    If rsFriend.EOF Then Exit for
Next
'Response.Write "</tr></table>"
end if
end if

%>


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
performance issue with the xsl given here anboss XSLT 11 July 16th, 2008 03:05 AM
Performance Issue of Execution bjohnjebastin ASP.NET 1.0 and 1.1 Basics 1 November 14th, 2005 10:18 AM
issue of performance alyeng2000 SQL Server 2000 6 August 20th, 2004 01:17 PM
Performance issue deyakhatib SQL Server 2000 2 June 21st, 2004 10:47 PM



All times are GMT -4. The time now is 04:07 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.