473,835 Members | 1,887 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp/access/sql page timing out

2 New Member
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 1487
jhardman
3,406 Recognized Expert Specialist
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
nick0123
2 New Member
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
2713
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 page. HTTP_REFERER, while not completely reliable, would serve the purpose except for another problem. The hyperlink points to a JavaScript function which opens the popup. This yields HTTP_REFERER worthless. My other thought was to create a...
3
2401
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 developing an app in Access 2000 but converted it several months ago to XP. So the app is now Access XP format also. My app is crashing on a regular basis, with the totally non-descript Microsoft error (Microsoft Access has encountered a...
14
5279
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 step through the VBA code, the crash does not occur. What is different about stepping through code instead of just running it? Any idea how to find the cause? I know about where it happens, but since it is Access itself crashing, finding a...
2
2289
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 data from an MS Access database, using ODBC and a stored query. There is no problem on my development machine. On the production server though, I get the intermittant error shown below. If I click back and forth between the problem page and the...
9
2456
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"); ucline.Initializecontrol(line,alternate); Placeholder1.Controls.Add(ucline); }
2
1550
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 code. I'm working on a page for a travel company. There's way too much going on with it/on it, but I'm kind of stuck at this point - the client loves it, so I have to solve this problem.
4
2351
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 code / queries ran slow due to access running the queries locally rather than on the server). And tested it on my and my boss's machine with no problems so he gave the go ahead to update everybody to our new mssql 2000 backend with the modified...
11
2486
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 the page doesn't get displatyed, and this goes on continuously. The main sympton is that the select box thats being populated gets a different number of rows loaded into it each time. And the last row that gets loaded is always truncated. Its...
0
1750
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 Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles
0
9803
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9652
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9344
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7766
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6963
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5636
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5804
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4433
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.