This probably means that the function "funcSummarySort" is recursively calling itself in an infinite loop and therefore the script has run out of stack space. If you are calling a function recursively make sure that it returns at some point of time.
Right I fixed the problem with this bit of code inserting it before the error occurred.
"On error Resume Next"
I've moved on to a new error
Microsoft OLE DB Provider for SQL Server error '80040e14'
Line 1: Incorrect syntax near 'AND14'.
/PolicySummary.asp, line 50
Can someone tell me what it means please. Thanks
"On Error Resume Next" has not fixed the error it merely suppresses it, as it is still happening but it is not totally killing the script.
I'd be very nervous about doing this - infinite recursive loops are a major resource drain and if this script gets used a lot you might find your hosting company having a few words about it if you are on a shared server.
The new error probably relates to a SQL statement where instead of using "AND" you have used "AND14".
I don't mean to be funny but for ASP errors it's often useful for us to be able to see the partial source that is generating the problem as we can often spot things you can't and can offer real solutions which solve the problem rather than disguising it.
I did know that it suppresses the error. You see the asp pages are designed to run reports and track certain email ativities in the organisation. Now the code is someone else's and I am just modifying it to our needs. I don't have to worry about banwidth or resource drain since the reports won't be day 2 day but mounthly. Plus we do have the resources to accomadate them.
Here is the code that where the first error occoured
'Modified to fix this error.
'Time Period: 5Hours Microsoft VBScript runtime error
'800a001c' Out of stack space: 'funcSummarySort' /Common.asp, line 125
On error Resume Next
'== 2 or more items in first section
if loBound < (hiSwap - 1) then Call funcSummarySort(vec,vec1,loBound,hiSwap-1)
'== 2 or more items in second section
if hiSwap + 1 < hiBound then Call funcSummarySort(vec,vec1,hiSwap+1,hiBound)
Can you see anything that I can do to fix it.
Here is the SQL statement.
' open the database connection
' if the connection was made then execute the query
If sqlSrv.State = adStateOpen Then
query="SELECT goaEngineDetail.StartTime strMsgTime, CategoryMap.MappedValue strScenario, moaMessage.MsgSize strMsgSize, moaMessage.ID strMsgID "+ _
"FROM ( goaEngineDetail goaEngineDetail INNER JOIN moaMessage moaMessage ON goaEngineDetail.ID = moaMessage.ID ) INNER JOIN goaCategoryMap CategoryMap ON moaMessage.Category = CategoryMap.MapID "+ _
"WHERE goaEngineDetail.StartTime "&strTime + _
"ORDER BY CategoryMap.MappedValue ASC ,goaEngineDetail.StartTime asc"
' response.Write (query)
' You will need to check the order of fields being returned from the SQL Query and enter the text bellow
dim arrayHeading (3,1)
arrayHeading (0,0)="Time Processed"
arrayHeading (2,0)="Message Size"
arrayHeading (3,0)="Message ID"
dim arrayBody (3)
'Execute the query
Set RS = sqlSrv.Execute(Query)
' Get summary data
' Graph some data More likely Summary Data
The SQL question doesn't have an obvious answer from the basic structure, any chance of getting a look at the exact SQL which is being run?
<added>This next bit assumes the SQL statement breaking the script is located after the "'Execute the query" line</added>
If you insert the following after the "'Execute the query" line you should be able to see the SQL being used;
The other question on the face of it seems to be a logic flaw - there must be a scenario where the code either iterates too many times or doesn't modify the values as expected.
I'll take a look at this but it's doubtful I'll spot the problem due to not knowing what the code is trying to do - you might be better off debugging the script with response.write's to figure out what the values are doing.
An example of this was a patch script I wrote this morning, I tested for a "greater than" scenario and a "less than" scenario but if the results were equal it fell through generating a null result - puzzled me a treat until I spotted the hole in my logic.
if request("Starttime")<>"" then
'Modified "AND" TO " AND "
strStart = "Between "& request("Starttime") &" AND "
strStart = " < "
if request("Endtime") <>"" then
strEnd = request("EndTime")
strEnd = "getDate ()"
strTime = strStart & strEnd
function funcHeading (arrayHeading)
dim intCount, intCurrent
Made a slight modification to "AND" . That got us onto this error
Microsoft VBScript runtime error '800a0009'
Subscript out of range: 'loSwap'
/Common.asp, line 100
Do you want me to post all of the script or email you the files. Thanks for you help.
No doesn't work, I dont know if you recieved the files, if you didn't give me a shout.
"If you insert the following after the "'Execute the query" line you should be able to see the SQL being used; "
This is the responce to the (query)
SELECT DISTINCT Recipients.MappedValue strReciverAddress , Senders.MappedValue strSendersAddress , moaMessage.MsgSize strMsgSize , goaEngineDetail.StartTime strMsgTime FROM (((moaMessage moaMessage INNER JOIN goaEngineDetail goaEngineDetail ON moaMessage.ID = goaEngineDetail.ID) INNER JOIN moaRecipients moaRecipients ON moaMessage.ID = moaRecipients.MapID) INNER JOIN moaAddressMap Senders ON moaMessage.Sender = Senders.MapID) INNER JOIN moaAddressMap Recipients ON moaRecipients.MappedValue = Recipients.MapID WHERE goaEngineDetail.StartTime Between 15/10/02 AND 18/10/02 ORDER BY Recipients.MappedValue ASC, Senders.MappedValue ASC