Solved

Active Server Pages error 'ASP 0115'

Posted on 2009-04-14
2
626 Views
Last Modified: 2012-05-06
Hello All,

I've got a website, that normally works fine, that said occasionally it throughs a glitch on a particular page, leading the advertised to think an error has occured and repost, when i tested this with friendly error messages off, I got the following error message -
"
Active Server Pages error 'ASP 0115'
Unexpected error
/employer/aftervacancyposted.asp
A trappable error (C0000005) occurred in an external object. The script cannot continue running."

I've done a little research and from what I can see it is an error occurs randomly??  With this in mind, what I would like to do is in the event that the error occurs, the user is redirected to an alternative page without realising that an error has occured?

Is this possible?
My code is below -

Thank you
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../Connections/recruta2.asp" -->
<!--#include file="../ScriptLibrary/incSmartMailer.asp" -->
<%
On Error resume Next
%><%
Dim VACANCY__MMColParam
VACANCY__MMColParam = "0"
If (Session("NEWVACANCY") <> "") Then 
  VACANCY__MMColParam = Session("NEWVACANCY")
End If
%>
<%
Dim VACANCY__MMColParam2
VACANCY__MMColParam2 = "0"
If (Session("EMPLOYEEID") <> "") Then 
  VACANCY__MMColParam2 = Session("EMPLOYEEID")
End If
%>
<%
Dim VACANCY__MMColParam3
VACANCY__MMColParam3 = "0"
If (Session("SITEID") <> "") Then 
  VACANCY__MMColParam3 = Session("SITEID")
End If
%>
<%
Dim VACANCY
Dim VACANCY_cmd
Dim VACANCY_numRows
 
Set VACANCY_cmd = Server.CreateObject ("ADODB.Command")
VACANCY_cmd.ActiveConnection = MM_recruta2_STRING
VACANCY_cmd.CommandText = "SELECT JBAID, JBAEmployeeID, JBASiteID, JBATitle, JBADatePosted, JBADescription, JBAPayRate, JBALocation, JBAEmplymentType, JBAReference, JBAConkersEmail FROM dbo.JBAdvert WHERE JBATitle = ? AND JBAEmployeeID = ? AND JBASiteID = ? AND JBADatePosted BETWEEN DATEADD(mi, -3, GETDATE()) AND GETDATE()" 
VACANCY_cmd.Prepared = true
VACANCY_cmd.Parameters.Append VACANCY_cmd.CreateParameter("param1", 200, 1, 255, VACANCY__MMColParam) ' adVarChar
VACANCY_cmd.Parameters.Append VACANCY_cmd.CreateParameter("param2", 5, 1, -1, VACANCY__MMColParam2) ' adDouble
VACANCY_cmd.Parameters.Append VACANCY_cmd.CreateParameter("param3", 5, 1, -1, VACANCY__MMColParam3) ' adDouble
 
Set VACANCY = VACANCY_cmd.Execute
VACANCY_numRows = 0
%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "0"
If (Session("SITEID")  <> "") Then 
  Recordset1__MMColParam = Session("SITEID") 
End If
%>
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
 
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_recruta2_STRING
Recordset1_cmd.CommandText = "SELECT JBSSiteID, JBSMetaTitle, JBSLogo, JBSMetaKeywords, JBSMetaDescription, JBSHomePageText, JBSURL, JBSURLShort, JBSNoReplyEmail FROM dbo.JBSite WHERE JBSSiteID = ?" 
Recordset1_cmd.Prepared = true
Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param1", 5, 1, -1, Recordset1__MMColParam) ' adDouble
 
Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<%
Dim USERS__MMColParam
USERS__MMColParam = "0"
If (Session("SITEID")  <> "") Then 
  USERS__MMColParam = Session("SITEID") 
End If
%>
<%
Dim USERS__MMColParam2
USERS__MMColParam2 = "%"
If (Session("NEWVACANCYLOCATION")  <> "") Then 
  USERS__MMColParam2 = Session("NEWVACANCYLOCATION") 
End If
%>
<%
Dim USERS__MMColParam3
USERS__MMColParam3 = "%"
If (Session("NEWVACANCYCATEGORY")   <> "") Then 
  USERS__MMColParam3 = Session("NEWVACANCYCATEGORY")  
End If
%>
<%
Dim USERS__MMColParam4
USERS__MMColParam4 = "%"
If (Session("NEWVACANCYDESCRIPTION")   <> "") Then 
  USERS__MMColParam4 = Session("NEWVACANCYDESCRIPTION")  
End If
%>
<%
Dim USERS
Dim USERS_cmd
Dim USERS_numRows
 
Set USERS_cmd = Server.CreateObject ("ADODB.Command")
USERS_cmd.ActiveConnection = MM_recruta2_STRING
USERS_cmd.CommandText = "SELECT * FROM dbo.JBEmailNotification WHERE JBENsiteID = ? AND JBENlocation = ? AND JBENcategory = ? AND ? like '%' + JBENKeyword + '%'" 
USERS_cmd.Prepared = true
USERS_cmd.Parameters.Append USERS_cmd.CreateParameter("param1", 5, 1, -1, USERS__MMColParam) ' adDouble
USERS_cmd.Parameters.Append USERS_cmd.CreateParameter("param2", 200, 1, 255, USERS__MMColParam2) ' adVarChar
USERS_cmd.Parameters.Append USERS_cmd.CreateParameter("param3", 200, 1, 255, USERS__MMColParam3) ' adVarChar
USERS_cmd.Parameters.Append USERS_cmd.CreateParameter("param4", 200, 1, 4000, USERS__MMColParam4) ' adVarChar
 
Set USERS = USERS_cmd.Execute
USERS_numRows = 0
%>
<%
' Smart Mailer 1.0.7
' Send on load
Server.ScriptTimeout = 300
Set sm2 = new SmartMailer
sm2.checkVersion "1.07"
sm2.contentCharset = "iso-8859-1"
Session.CodePage = sm2.getCodepage()
sm2.smtpSetup "", "", "", ""
sm2.pickup = ""
sm2.component = "cdo"
sm2.tmpFolder = ""
sm2.embedImages = false
sm2.progressBar = ""
sm2.ignore_errors = true
sm2.useQueue = false
sm2.setFrom Recordset1.Fields.Item("JBSURLShort").Value, Recordset1.Fields.Item("JBSNoReplyEmail").Value
sm2.setTo Session("EMPLOYEENAME"), Session("EMPLOYEEUSERNAME")
sm2.setCc "", ""
sm2.setBcc "", ""
sm2.Subject = "Vacancy title " & (VACANCY.Fields.Item("JBATitle").Value) & " posted on " & (Recordset1.Fields.Item("JBSURLShort").Value) & ""
' using static for body
sm2.setBody_Static_text "Dear " & (Session("EMPLOYEENAME")) & "," & vbCRLF & "" & vbCRLF & "Your vacancy titled " & (VACANCY.Fields.Item("JBATitle").Value) & " has successfully been posted on " & (Recordset1.Fields.Item("JBSURLShort").Value) & "" & vbCRLF & "" & vbCRLF & "Kind regards"
' Attachments none
sm2.sendMail "one"
%>
<%
' Smart Mailer 1.0.7
' Send on load
Server.ScriptTimeout = 300
Set sm1 = new SmartMailer
sm1.checkVersion "1.07"
sm1.contentCharset = "iso-8859-1"
Session.CodePage = sm1.getCodepage()
sm1.smtpSetup "", "", "", ""
sm1.pickup = ""
sm1.component = "cdo"
sm1.tmpFolder = ""
sm1.embedImages = true
sm1.progressBar = ""
sm1.ignore_errors = true
sm1.useQueue = false
sm1.setFrom Recordset1.Fields.Item("JBSURLShort").Value, Recordset1.Fields.Item("JBSNoReplyEmail").Value
Set sm1.toRecord = USERS
sm1.toRecordName = "JBENname"
sm1.toRecordEmail = "JBENusername"
sm1.total_mail = sm1.getTotalRecords(USERS)
while not sm1.toRecord.EOF
  sm1.setTo sm1.toRecord.Fields.Item(sm1.toRecordName).Value, sm1.toRecord.Fields.Item(sm1.toRecordEmail).Value
  sm1.Subject = "" & (VACANCY.Fields.Item("JBATitle").Value) & " advertised on " & (Recordset1.Fields.Item("JBSURLShort").Value) & ""
  ' using template for body
  sm1.setBody_Template_html "vacancynotification.asp?ID=" & (VACANCY.Fields.Item("JBAID").Value) & ""
  ' Attachments none
  sm1.sendMail "multiple"
  USERS.MoveNext()
Wend
sm1.done()
Response.Redirect "aftervacancyposted2.asp"
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>vacancy posted</title>
</head>
 
<body>
</body>
</html>
<%
VACANCY.Close()
Set VACANCY = Nothing
%>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
USERS.Close()
Set USERS = Nothing
%>

Open in new window

0
Comment
Question by:garethtnash
2 Comments
 
LVL 16

Accepted Solution

by:
sunithnair earned 500 total points
ID: 24136744
Yes you should be able to redirect the user if there is an error on the page. Check this link for more information http://www.15seconds.com/issue/990603.htm
0
 

Author Comment

by:garethtnash
ID: 24368380
OK I guess the real question here should be, can anyone see what is causing the error to occur?
 
Many thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
toggle checkboxes when a checkbox is checked 16 58
Save ms data to server side. 19 55
Hide Table in merge 3 29
Obtaining data on ASP 8 28
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question