Populating a table

Results 1 to 3 of 3

Thread: Populating a table

  1. #1
    Jean-Luc Guest

    Default Populating a table

    I am populating a table from a database. I displayed the timestamp at the<BR>beginning of the page and one at the end and it looks it take about 3seconds<BR>to do job. However to display the page it takes ages although it&#039s not more<BR>than 20 lines. What&#039s could be wrong<BR><BR><BR><BR>

  2. #2
    Zola Guest

    Default RE: Populating a table

    Do the other pages take a lot of time, or just this one?

  3. #3
    Jean-Luc Guest

    Default RE: Populating a table

    No, the other ones just come up on the spot. Here is the code :<BR><BR>&#060;%@ Language=VBScript%&#062;<BR>&#060;!--#INCLUDE FILE="../adovbs.inc"--&#062;<BR>&#060;!--#include FILE="../Variables.inc"--&#062;<BR>&#060;html&#062;<BR>&#060;head&#062;<BR> &#060;title&#062;LN&#060;/title&#062;<BR>&#060;/head&#062;<BR>&#060;style&#062;<BR>&#060;!--<BR>BODY { font-family:"Verdana"; color: #990000 }<BR>--&#062;<BR>&#060;/style&#062;<BR>&#060;body background=../images/Backgrnd.gif bgproperties=fixed&#062;<BR>&#060;% <BR>Const iLNDefaultDining = 6<BR>Const iLNDefaultKitchen = 1<BR><BR>Const iLNGameToUpdate = 2 <BR><BR>Const iLNiGoal = 20<BR>Const iLNiYellowCard = 21<BR>Const iLNiRedCard = 22<BR>Const iLNiSubstitution = 23<BR><BR>Const iLNtWhat = 24<BR>Const iLNtWho = 25<BR>Const iLNtWhen = 26<BR>Const iLNtRemarks = 27<BR>const iLNiOwnGoal = 28<BR>Const iLNCCodeTypeEvent = 10<BR><BR>Session("LanguageId") =1<BR><BR>set conLN = Server.CreateObject("ADODB.Connection")<BR>conLN.C onnectionTimeout = Application("conLN_ConnectionTimeout")<BR>conLN.Co mmandTimeout = Application("conLN_CommandTimeout")<BR>conLN.Curso rLocation = Application("conLN_CursorLocation")<BR>conLN.Open Application("conLN_ConnectionString"), Application("conLN_RuntimeUserName"), Application("conLN_RuntimePassword")<BR>if Session("srsRecSet")=0 then<BR> Response.Write "&nbsp;"<BR>else <BR>%&#062;<BR>&#060;table border="0" width="100%" cellpadding="0" cellspacing="0" align="center"&#062;<BR> &#060;tr&#062;<BR> &#060;td colspan="4" bgcolor=#ffcccc&#062;<BR> &#060;STRONG&#062;&#060;FONT size=2 face="Verdana, Arial"&#062;Déroulement de la partie&#060;/STRONG&#062;&#060;/FONT&#062;<BR> &#060;/td&#062;<BR> &#060;tr&#062;<BR> &#060;td width="3%"&#062;<BR> &#060;FONT size=1 face="Verdana, Arial"&#062;<BR> &nbsp;<BR> &#060;/font&#062;<BR> &#060;/td&#062;<BR> &#060;td width="30%"&#062;<BR> &#060;FONT size=1 face="Verdana, Arial"&#062;<BR> Qui<BR> &#060;/font&#062;<BR> &#060;/td&#062;<BR> &#060;td width="7%" &#062;<BR> &#060;FONT size=1 face="Verdana, Arial"&#062;<BR> Min<BR> &#060;/font&#062;<BR> &#060;/td&#062;<BR> &#060;td width="50%" &#062;<BR> &#060;FONT size=1 face="Verdana, Arial"&#062;<BR> Remarque<BR> &#060;/font&#062;<BR> &#060;/td&#062;<BR> &#060;/tr&#062; <BR> &#060;/tr&#062; <BR> &#060;%<BR> siGoal = "../images/LNBall.gif"<BR> siOwnGoal = "../images/LNOwnGoal.gif"<BR> siYellowCard = "../images/LNYellowCard.gif"<BR> siRedCard = "../images/LNRedCard.gif"<BR> siSubs = "../images/LNSubstitution.gif"<BR><BR> Set rsRecCode = Server.CreateObject("ADODB.Recordset")<BR> <BR> sSQL = " SELECT tblCodes.Cd_Nbr,tblCodes.Cd_Text"<BR> sSQL = sSQL & " FROM tblCodes"<BR> sSQL = sSQL & " WHERE Cd_Type=10"<BR> sSQL = sSQL & " AND Cd_Language =" & Session("LanguageId")<BR> sSQL = sSQL & " ORDER BY Cd_Nbr"<BR> rsRecCode.open sSQL,conLN,adOpenForwardOnly,adLockReadOnly,adCmdT ext <BR> iNbrPlayer=0<BR> Redim vCodeEvent(1, 0)<BR> <BR> do while not rsRecCode.EOF<BR> iNbrPlayer = iNbrPlayer + 1<BR> <BR> Redim preserve vCodeEvent(1, iNbrPlayer) <BR><BR> vCodeEvent(1, iNbrPlayer) = rsRecCode("Cd_Text")<BR> <BR> rsRecCode.movenext<BR> <BR> loop<BR> rsRecCode.close<BR> set rsRecCode = nothing<BR><BR> Set rsRecEventb2 = Server.CreateObject("ADODB.Recordset")<BR> sSQL = " SELECT tblLeagueEvent.Le_Id, Le_Type, Le_TeamId, tblPlayer.P_FirstName, tblPlayer.P_LastName, tblLeagueEvent.Le_Minute, tblLeagueEvent.Le_Remark"<BR> sSQL = sSQL & " FROM tblLeagueEvent INNER JOIN tblPlayer ON tblLeagueEvent.Le_PlayerId = tblPlayer.P_Id"<BR> sSQL = sSQL & " WHERE Le_Display=-1 AND tblLeagueEvent.Le_GameId=" & Session("Lg_Id")<BR> sSQL = sSQL & " ORDER BY tblLeagueEvent.Le_Id DESC;"<BR> rsRecEventb2.open sSQL,conLN,adOpenForwardOnly,adLockReadOnly,adCmdT ext <BR> if rsRecEventb2.EOF then<BR> else<BR> rsRecEventb2.movefirst<BR> <BR> bShade = false<BR> <BR> do while not rsRecEventb2.EOF<BR> if bShade = false then<BR> bShade = true<BR> sbgColor = "bgcolor=#ffcccc"<BR> else<BR> bShade = false<BR> sbgColor = "bgcolor=#ff9999"<BR> end if<BR> if rsRecEventb2("Le_Type") &#062; 6 and rsRecEventb2("Le_Type")&#060; 15 then<BR> sbgColor = "bgcolor=#99cc99"<BR> end if<BR> <BR> %&#062;<BR> &#060;tr&#062;<BR> &#060;td width="3%" &#060;%=sbgColor%&#062; align="center"&#062;<BR> &#060;%<BR> select case rsRecEventb2("Le_Type")<BR> case cEventGoal<BR> sSrc = "&#060;img border=""0"" src=""" & siGoal & """&#062;"<BR> Response.Write sSrc<BR> <BR> case cEventAutoGoal<BR> sSrc = "&#060;img border=""0"" src=""" & siOwnGoal & """&#062;"<BR> Response.Write sSrc<BR> <BR> case cEventYellowCard<BR> sSrc = "&#060;img border=""0"" src=""" & siYellowCard & """&#062;"<BR> Response.Write sSrc<BR> <BR> case cEventRedCard<BR> sSrc = "&#060;img border=""0"" src=""" & siRedCard & """&#062;"<BR> Response.Write sSrc<BR> <BR> case cEventSubstitution<BR> sSrc = "&#060;img border=""0"" src=""" & siSubs & """&#062;"<BR> Response.Write sSrc<BR> case else<BR> Response.Write "&nbsp;"<BR> <BR> end select<BR> %&#062;<BR> &#060;/td&#062;<BR> &#060;td width="30%" &#060;%=sbgColor%&#062;&#062;<BR> &#060;FONT size=1 face="Verdana, Arial"&#062;<BR> &#060;%<BR> if rsRecEventb2("Le_Type") &#060; cEventStartGame then<BR> if Session("HomeTeam") = rsRecEventb2("Le_TeamId") then<BR> sTeam = Session("sHomeTeam")<BR> else<BR> sTeam = Session("sAwayTeam")<BR> end if <BR> Response.Write rsRecEventb2("P_LastName") & "(" & sTeam & ")"<BR> else<BR> iIdx = rsRecEventb2("Le_Type")<BR> Response.Write vCodeEvent(1, iIdx) <BR> end if<BR> %&#062;<BR> &#060;/FONT&#062;<BR> &#060;/td&#062;<BR> &#060;td width="3%" &#060;%=sbgColor%&#062; align="center"&#062;<BR> &#060;FONT size=1 face="Verdana, Arial"&#062;<BR> &#060;%<BR> if rsRecEventb2("Le_Type") &#060; cEventStartGame or rsRecEventb2("Le_Type") = cEventNeutral then<BR> Response.Write rsRecEventb2("Le_Minute")<BR> else<BR> Response.Write "&nbsp;"<BR> end if<BR> %&#062;<BR> &#060;/FONT&#062;<BR> &#060;/td&#062;<BR> &#060;td width="50%" &#060;%=sbgColor%&#062;&#062;<BR> &#060;FONT size=1 face="Verdana, Arial"&#062;<BR> &#060;%<BR> if rsRecEventb2("Le_Remark") = "" or rsRecEventb2("Le_Remark") = " " or rsRecEventb2("Le_Remark") = null then<BR> Response.Write "&nbsp;"<BR> else<BR> Response.Write rsRecEventb2("Le_Remark")<BR> end if<BR> %&#062;<BR> &#060;/FONT&#062;<BR> &#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;%<BR> rsRecEventb2.movenext<BR> loop<BR> end if <BR> rsRecEventb2.Close<BR> set rsRecEventb2=nothing <BR> %&#062;<BR> &#060;/tr&#062; <BR>&#060;/table&#062; <BR>&#060;%<BR>end if<BR>set conLN = nothing<BR>%&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •