Wrox Programmer Forums
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 23rd, 2006, 10:57 AM
Friend of Wrox
Join Date: May 2005
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
                intFinish = intStart + (rsFriend.PageSize - 1)
            End if
        End If

numberOfColumns =5
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
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>
                <%if rsFriend("gender")="male" then%>
                <IMG alt=<%=rsFriend("firstname")%> src="user_images/noimage_male.jpg" width=<%=intWidth%> height=<%=intHeight%> border=0>
                <IMG alt=<%=rsFriend("firstname")%> src="user_images/noimage_female.jpg" width=<%=intWidth%> height=<%=intHeight%> border=0>
                <%end if%>

                <%end if%>
<br><%if strOnline="y" then response.write "Online" else response.write "Offline"%>
 columnsDone = columnsDone + 1

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


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 11: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

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.