Copy link to clipboard
Copied
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
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.
Copy link to clipboard
Copied
Can you post the code of the page that contained the error and identify line 24?
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
haven't had any problems since - may have been a one off. Hope it stays that way!
Thank you very much for your help