Newbie ASP script issue

S

Sabir Ahmedi

Hi all,

I have a problem with my ASP script below and the error message is:

"The maximum amount of time for a script to execute was exceeded. You can
change this limit by specifying a new value for the property
Server.ScriptTimeout or by changing the value in the IIS administration
tools."

Tried changing values in the IIS admin console but didnt work.

Thanks.

Sabir.


<%@ LANGUAGE="VBScript" %>
<% Server.ScriptTimeout = 180 %>

<!--#include file = "ProductionErrorHandler.inc" -->
<HTML>
<HEAD>
<TITLE> College Message Board - Main</TITLE>
</HEAD>

<BODY vlink = red>

<!--Categories -->
<h1 align="center"><b><font color = "#000080">Ramapo College Message
Board</font></b></h1>

<center>
<font color="#000099"><b><font size="2"><a href = "Index.asp">All
Ads</a></font></b></font><font color="#000099"><b><font size="2"> •
<a href = "Announcements.asp">Announcements</a> • <a href =
"Automotive.asp">Automotive</a>
• <a href = "Books.asp"> Books</a> • <a href =
"Electronics.asp">Electronics</a>
• <a href = "Employment.asp">Employment</a> • <a href =
"Furniture.asp">Furniture</a>
<br>
<a href = "Housing.asp">Housing</a> • <a href =
"LostandFound.asp">Lost
& Found</a> • <a href = "Misc.asp">Misc</a> •
<a href = "Meetings.asp">Meetings</a> • <a href =
"Services.asp">Services</a>
• <a href = "TicketsandEvents.asp">Tickets & Social
Events</a> • <a href = "Tutors.asp">Tutors</a> •
<a href = "SubmitAd.htm">Submit Ad</a></font></b></font>
</center>

<BR>

<!--Create Column Headers -->
<table align = 'Center' border = '0' bgcolor = "#000000">
<tr>
<th bgcolor="#666699" font-weight=Bold size= 12pt family= "Times New
Roman,Courier,Arial" align=center; width=250px><font
color="#FFFFFF">Category</font></th>
<th bgcolor="#666699" font-weight=Bold size= 12pt family= "Times New
Roman,Courier,Arial" align=center; width=250px><font
color="#FFFFFF">Title</font></th>
<th bgcolor="#666699" font-weight=Bold size= 12pt family= "Times New
Roman,Courier,Arial" align=center; width=250px><font
color="#FFFFFF">Price</font></th>
<th bgcolor="#666699" font-weight=Bold size= 12pt family= "Times New
Roman,Courier,Arial" align=center; width=250px><font
color="#FFFFFF">Contact</font></th>
<th bgcolor="#666699" font-weight=Bold size= 12pt family= "Times New
Roman,Courier,Arial" align=center; width=250px><font color="#FFFFFF">Date
Posted</font></th>
</tr>
<%

' Ignore Error and continue to execute that application

On Error Resume Next

' Create Date to use in SQL query
Dim Today
Today = Date

' Create Recordset and Open Connection
Dim adoConnection
Dim adoRecordset

Set adoConnection = Server.CreateObject("ADODB.Connection")
Set adoRecordset = Server.CreateObject("ADODB.Recordset")

adoConnection.Open "DSN=RamapoClassifieds; pwd=classifieds"

' Create query to pull information from database
Dim mySQL
mySQL= "SELECT MessageID,Category,Title,Price,FirstName,DateApproved "
mySQL = mySQL & " FROM Messages "
mySQL = mySQL & " WHERE Expires >= Date() AND Approved=Yes "
mySQL = mySQL & " ORDER BY DateApproved DESC;"

adoRecordset.Open mySQL, adoConnection

'Check for Errors
Call ErrorHandler(adoConnection)

' Create table with alternating row colors

Dim counter
Dim RowColor
Dim StringPrice

counter = 0

Do while NOT adoRecordset.Eof AND NOT adoRecordset.Bof

If counter MOD 2 = 0 Then
RowColor= "#FFFFFF"
Else
RowColor= "#CCCCCC"
End If

Response.Write("<tr bgcolor ='" & RowColor & "'>")
Response.Write("<TD WIDTH=250px><B><CENTER><FONT SIZE=2>" &
adoRecordset("Category") & "</FONT></CENTER></B></TD>")
Response.Write("<TD WIDTH=250px><B><CENTER><FONT SIZE=2><A HREF =
'ContactInfo.asp?MessageID=" & adoRecordset("MessageID") & "'>" &
adoRecordset("Title") & "</A></FONT></B></CENTER></TD>")
Response.Write("<TD WIDTH=250px><B><CENTER><FONT SIZE=2>" &
adoRecordset("Price") & "</FONT></CENTER></B></TD>")
Response.Write("<TD WIDTH=250px><B><CENTER><FONT SIZE=2>" &
adoRecordset("FirstName") & "</FONT></CENTER></B></TD>")
Response.Write("<TD WIDTH=250px><B><CENTER><FONT SIZE=2>" &
adoRecordset("DateApproved") & "</FONT></CENTER></B></TD>")
Response.Write("</TR>")

counter= counter + 1
adoRecordset.MoveNext
Loop

'Check for Errors
Call ErrorHandler(adoConnection)

' Clean up
adoRecordset.Close()
set adoRecordset = nothing

adoConnection.Close()
set adoConnection = nothing

%>
</table>
</BODY>
</HTML>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top