R
RoadKill
I have ASP forms to update my database. However if someone tried to submit a
duplicate entry, it just gives an ugly ASP error message that makes no sense
to an average user.
How can I create a custom error message when this happens. I am assuming an
If then statement can be applied to the Insert command but am not sure how to
pull that off.
Thanks!
strSQL = "INSERT INTO NewResults(Supervisor, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8,
Q9, Q10, User_name, PostedOn, ReviewType, Center) Values('" &
request.form("Supervisor") & "', '" & request.form("Q1") & "', '" &
request.form("Q2") & "', '" & request.form("Q3") & "', '" &
request.form("Q4") & "', '" & request.form("Q5") & "', '" &
request.form("Q6") & "', '" & request.form("Q7") & "', '" &
request.form("Q8") & "', '" & request.form("Q9") & "', '" &
request.form("Q10") & "', '" & request.form("User_name") & "', '" &
request.form("PostedOn") & "', '" &
request.form("ReviewType") & "', '" & request.form("Center") & "')"
duplicate entry, it just gives an ugly ASP error message that makes no sense
to an average user.
How can I create a custom error message when this happens. I am assuming an
If then statement can be applied to the Insert command but am not sure how to
pull that off.
Thanks!
strSQL = "INSERT INTO NewResults(Supervisor, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8,
Q9, Q10, User_name, PostedOn, ReviewType, Center) Values('" &
request.form("Supervisor") & "', '" & request.form("Q1") & "', '" &
request.form("Q2") & "', '" & request.form("Q3") & "', '" &
request.form("Q4") & "', '" & request.form("Q5") & "', '" &
request.form("Q6") & "', '" & request.form("Q7") & "', '" &
request.form("Q8") & "', '" & request.form("Q9") & "', '" &
request.form("Q10") & "', '" & request.form("User_name") & "', '" &
request.form("PostedOn") & "', '" &
request.form("ReviewType") & "', '" & request.form("Center") & "')"