Skip to main content
Known Participant
June 30, 2010
Answered

asp error - redirect page

  • June 30, 2010
  • 1 reply
  • 1097 views

Hi Everyone,

I have created a simple booking form.

Everything works fine -  but one customer emailed me saying they received an error when they clicked submit. I have thoroughly tested the form and even sumitted the same details that customer entered and did not have any errors.

Could this be because of the traffic on the website? (there have been hundreds of bookings within a few days)

Rather than a error message appearing - how can I redirect the page to a message that says 'try again in a few mintues?'

Not sure where to put the redirect code.

This was the error message the received:-

Microsoft OLE DB Provider for SQL Server error '80040e14'

Incorrect syntax near 'm'.

/marketing.asp, line 24

I am so certain I have no errors in my script. I am using asp.

Hope someone can help!

Thanks in advance

This topic has been closed for replies.
Correct answer bregent

Classic ASP does not have good custom error handling, but it can be done. You'll need to use the 'On Error Goto' statement and examine the SQL connection error code - then redirect to an appropriate message page.

1 reply

Participating Frequently
June 30, 2010

Can you post the code of the page that contained the error and identify line 24?

dips045Author
Known Participant
July 1, 2010

hi there

line 24 is:-

conn.execute(SQLTemp)

the line before that is:-

SQLTemp = "INSERT INTO booking (firstname, surname, email, phone, gender, company_name, address1, address2, address3, town, postcode) values ('" & firstname & "','" & surname & "','" & email & "','" & phone & "','" & gender & "','" & company_name & "','" & address1 & "','" & address2 & "','" & address3 & "','" & town & "','" & postcode & "'')"

Its weird as we've had bookings come through fine. So i thought that having a 'try again' message would be appropriate rather than an error message.

Any ideas?

bregentCorrect answer
Participating Frequently
July 1, 2010

Classic ASP does not have good custom error handling, but it can be done. You'll need to use the 'On Error Goto' statement and examine the SQL connection error code - then redirect to an appropriate message page.