473,326 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

asp/access/sql page timing out

Newbie-ish here...

I have made a simple database in MS Access 2003 listing sports teams, their playing dates, opposition venues etc. The database has six tables, one for each sport.

Exporting the first table as an asp page lets me view the details for that particular sport.

To view all the other sports on the same page, I copied/pasted the sql code, replacing the names of the sport.

Locally, this page takes about a second to generate. But loaded onto our intranet server, it always times out after loading only the first sport. I am wondering if I needed to change any part of the sql code in case it is trying to 'overwrite' itself to load the next sport?

The code below is a section of the page, taking in two of the six sports:

Expand|Select|Wrap|Line Numbers
  1. <%
  2.     Set conn = Server.CreateObject("ADODB.Connection")
  3.     conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\wwwroot\sport\gamedraw.mdb;Persist Security Info=False"%>
  4. <%
  5.     sql = "SELECT basketball.game_date, basketball.game_team, basketball.game_opposition, basketball.game_time, basketball.game_venue, basketball.game_results, basketball.game_comments FROM basketball   ORDER BY basketball.game_team   "
  6.         Set rs = Server.CreateObject("ADODB.Recordset")
  7.     rs.Open sql, conn, 3, 3
  8.     If rs.eof Then
  9.         rs.AddNew
  10.     End If
  11.     Set Session("gamedraw_rs") = rs
  12. %>
  13. <table width="550" border="0" bgcolor="#000000"><tr><td width="200"><font face="Verdana" size="2" color="#FFE400"><b>Basketball</b></font></td><td width="350" align="right"><a href="/sport/dbeditor/" class="black"><font face="Tahoma" size="1">edit</a></font></td></tr></table>
  14. <TABLE width="550" BORDER="1" bordercolor="#000000" BGCOLOR="#ffffff" CELLPADDING="3" cellspacing="0">
  15.  
  16. <THEAD>
  17. <TR>
  18.  
  19. <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000>Date</FONT></TH>
  20. <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000>Team</FONT></TH>
  21. <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000>Opposition</FONT></TH>
  22. <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000>Time</FONT></TH>
  23. <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000>Venue</FONT></TH>
  24. <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000>Results</FONT></TH>
  25. <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000>Comments</FONT></TH>
  26.  
  27. </TR>
  28. </THEAD>
  29. <TBODY>
  30. <%
  31. On Error Resume Next
  32. rs.MoveFirst
  33. do while Not rs.eof
  34.  %>
  35. <TR VALIGN=TOP>
  36.  
  37. <TD BORDERCOLOR=#c0c0c0 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("game_date").Value)%><BR></FONT></TD>
  38. <TD BORDERCOLOR=#c0c0c0 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("game_team").Value)%><BR></FONT></TD>
  39. <TD BORDERCOLOR=#c0c0c0 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("game_opposition").Value)%><BR></FONT></TD>
  40. <TD BORDERCOLOR=#c0c0c0 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("game_time").Value)%><BR></FONT></TD>
  41. <TD BORDERCOLOR=#c0c0c0 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("game_venue").Value)%><BR></FONT></TD>
  42. <TD BORDERCOLOR=#c0c0c0 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("game_results").Value)%><BR></FONT></TD>
  43. <TD BORDERCOLOR=#c0c0c0 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("game_comments").Value)%><BR></FONT></TD>
  44.  
  45. </TR>
  46. <%
  47. rs.MoveNext
  48. loop%>
  49. </TBODY>
  50. <TFOOT></TFOOT>
  51. </TABLE>
  52.  
  53. <%
  54.     Set conn = Server.CreateObject("ADODB.Connection")
  55.     conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\wwwroot\sport\gamedraw.mdb;Persist Security Info=False"%>
  56. <%
  57.     sql = "SELECT hockey.game_date, hockey.game_team, hockey.game_opposition, hockey.game_time, hockey.game_venue, hockey.game_results, hockey.game_comments FROM hockey   ORDER BY hockey.game_team   "
  58.         Set rs = Server.CreateObject("ADODB.Recordset")
  59.     rs.Open sql, conn, 3, 3
  60.     If rs.eof Then
  61.         rs.AddNew
  62.     End If
  63.     Set Session("gamedraw_rs") = rs
  64. %>
  65. <p></p><table width="550" border="0" bgcolor="#000000"><tr><td width="200"><font face="Verdana" size="2" color="#FFE400"><b>Hockey</b></font></td><td width="350" align="right"><a href="/sport/dbeditor/" class="black"><font face="Tahoma" size="1">edit</a></font></td></tr></table>
  66. <TABLE width="550" BORDER="1" bordercolor="#000000" BGCOLOR="#ffffff" CELLPADDING="3" cellspacing="0">
  67.  
  68.  
  69. <THEAD>
  70. <TR>
  71.  
  72. <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000>Date</FONT></TH>
  73. <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000>Team</FONT></TH>
  74. <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000>Opposition</FONT></TH>
  75. <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000>Time</FONT></TH>
  76. <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000>Venue</FONT></TH>
  77. <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000>Results</FONT></TH>
  78. <TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000>Comments</FONT></TH>
  79.  
  80. </TR>
  81. </THEAD>
  82. <TBODY>
  83. <%
  84. On Error Resume Next
  85. rs.MoveFirst
  86. do while Not rs.eof
  87.  %>
  88. <TR VALIGN=TOP>
  89.  
  90. <TD BORDERCOLOR=#c0c0c0 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("game_date").Value)%><BR></FONT></TD>
  91. <TD BORDERCOLOR=#c0c0c0 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("game_team").Value)%><BR></FONT></TD>
  92. <TD BORDERCOLOR=#c0c0c0 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("game_opposition").Value)%><BR></FONT></TD>
  93. <TD BORDERCOLOR=#c0c0c0 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("game_time").Value)%><BR></FONT></TD>
  94. <TD BORDERCOLOR=#c0c0c0 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("game_venue").Value)%><BR></FONT></TD>
  95. <TD BORDERCOLOR=#c0c0c0 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("game_results").Value)%><BR></FONT></TD>
  96. <TD BORDERCOLOR=#c0c0c0 ><FONT style=FONT-SIZE:10pt FACE="Verdana" COLOR=#000000><%=Server.HTMLEncode(rs.Fields("game_comments").Value)%><BR></FONT></TD>
  97.  
  98. </TR>
  99. <%
  100. rs.MoveNext
  101. loop%>
  102. </TBODY>
  103. <TFOOT></TFOOT>
  104. </TABLE>
  105.  
I have searched the forums here, but haven't found anything similar to this.

Suggestions would be welcomed, as I imagine there is a far more economical way to code this. Many thanks.
May 17 '07 #1
2 1459
jhardman
3,406 Expert 2GB
Nick,

This times-out even before the second sport is displayed? It sounds like a loop isn't executing correctly. Since it works once then breaks, I would guess that an error is occurring between the two loops which negates your loop advance mechanism. This would normally stop the script, but your "on error" line is keeping it going. Take out the "on error" line and see what errors are coming up.
(oh, and you shouldn't have two "on error" lines. I don't think that is causing the problem, but you never need two)

Jared
May 18 '07 #2
Jared, thanks so much for your help. I did what you suggested and removed the onError lines and the error that appeared was to do with html encoding of the final field - game_comments.

I removed it from the first query and it was fine, but errored on the second sport so had to remove them all.

Now the asp page generates in about a second when on the server - I still don't understand why it worked fine from http://localhost so well but not from the server, but at least the problem is fixed.

Thanks again for the help - much appreciated!!
May 18 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Xenophobe | last post by:
I have a popup window (required by the client) containing a form and would like to prevent users from accessing it directly. They are instead required to access the page via a hyperlink on another...
3
by: pbbriggs | last post by:
I will try to be as descriptive as possible, but this error has me stumped and I am not sure what relevant info to include.... I am running Access XP on a Windows XP machine. I initially began...
14
by: JK Peck | last post by:
I have a fairly large Access application that ran correctly in Access 2000. After upgrading to Access 2003 (and recompiling and updating references), it reliably crashes at a certain point. If I...
2
by: Chuck Ritzke | last post by:
Hi all, I am getting an intermittant error after uploading a project from my development machine. I click on a link which opens an aspx page that, upon page load, reads a very small amount of...
9
by: Anders K. Jacobsen [DK] | last post by:
Hi I have this that adds some usercontrol (UCTodays.ascx) to a placeholder foreach(A a in B){ UCTodays ucline = (UCTodays )LoadControl("UCTodays.ascx");...
2
by: julie.siebel | last post by:
Google apparently ate my original post to this (grr) so this'll be a bit more vague than the initial post, but...*sigh*. Javascript is not my forte, and I apologize for the acky-ness of the...
4
by: ThePhenix | last post by:
Hi everybody, I have recently been doing a conversion for my boss for a access 2000 database (both front and backend) to a MSSQL backend. I finished the conversion today (as quite a lot of the...
11
by: PW | last post by:
One of my ASP's was working fine for a long time. Now it has started constantly refreshing itself. Everytime I run it I just get the first part of the page, then it refreshes itself, the rest of...
0
by: champagne.supernova1974 | last post by:
Hi Can anyone help with a quick question? I am adding a textbox into each "day" cell of a calendar control, by using the following code in the DayRender event: Protected Sub...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.