script Timeout

G

Gary

I'm fairly new to ASP and have attempted to create a link tracker using SQL
Stored Procedures. The procedures work but my script timesout when calling
them through ASP

Script is below, any help would be gratefully appreciated.

Gary Smith

------------------------CODE -------------------------------
<%@ Language=VBScript %>
<%
Option Explicit
Response.Buffer = True
%>
<!-- #include file="DBConnectTracker.inc"-->
<%
Dim strLinkID
Dim cnnLinkTracker
Dim rsGetLink
Dim rsLinkTracker
Dim rsLinkTrackerMod
Dim strLinkName

strLinkID = Request.QueryString("LinkID")

If strLinkID > "" Then
' Create a new connection
Set cnnLinkTracker = GetDBConnection()
'Get Link Information from Database
set rsGetLink = server.createobject("adodb.recordset")
rsGetLink.Open "Exec getLink " & strLinkID ,cnnLinkTracker

'Set default link target
If rsGetLink.EOF Then
strLinkName = "nolink.asp"
Else
strLinkName = rsGetLink("page")
'Get Link Tracker Information from Database
Set rsLinkTracker = Server.CreateObject("ADODB.Recordset")
rsGetLink.Open "Exec getLinkTracker " & strLinkID ,cnnLinkTracker
'Create Object for Insert or Update Procedure
Set rsLinkTrackerMod = Server.CreateObject("ADODB.Recordset")
If rsLinkTracker.EOF Then
rsLinkTrackerMod.Open "Exec insertLinkTracker " & strLinkID
,cnnLinkTracker
Else
rsLinkTrackerMod.Open "Exec updateLinkTracker " & strLinkID
,cnnLinkTracker
End If

' Close our recordset objects
rsGetLink.Close
Set rsGetLink = Nothing
rsLinkTrackerMod.Close
Set rsLinkTrackerMod = Nothing
rsLinkTracker.Close
Set rsLinkTracker = Nothing

' Kill our connection
cnnLinkTracker.Close
Set cnnLinkTracker = Nothing
End If
Else
'Set default link target
strLinkName = "nolink.asp"
End If
'Redirect to target link
Response.Redirect strLinkName
%>

-----------------CODE-----------------------
 
B

Bob Barrows [MVP]

Gary said:
I'm fairly new to ASP and have attempted to create a link tracker
using SQL Stored Procedures. The procedures work but my script
timesout when calling them through ASP
<snip>

My first step would be to use SQL Profiler to trace what is happening on the
SQL Server while this page is running. You can even add the Stored Procedure
events to the trace to see the line-by-line execution of your procedures.

If that does not help you find the bottleneck, then you are going to have to
use some response.write statements to figure out which statement is causing
the timeout. Something like:
Response.Write "About to execute ""Exec getLink " & _
strLinkID & """<BR>"
rsGetLink.Open "Exec getLink " & strLinkID ,cnnLinkTracker
Response.Write "Successfully executed ""Exec getLink " & _
strLinkID & """<BR>"

Turn off Response.Buffer so you can see the results of the response.writes.
If that does not work, you'll have to use Response.End statements to see the
results.

HTH,
Bob Barrows
 

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

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top