|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
display error message on constrain violation
i've got a form to edit data or delete a record in sql server. if the delete fails on a constraint violation, nothing happens and of course the record is still there. how can a check to see if this has occured and display a friendly message for the user so they know why the record will not delete. i've tried
ret_string = Connection.execute(sqlstmt) but that doesn't get anything. thanks for any help |
|
#2
|
|||
|
|||
|
First of all, you cannot use a statement of the form
x = Conn.Execute (SQL) It will have to be Conn.Execute (SQL). Can you describe your problem a little more? I do not know exactly, what you mean.... |
|
#3
|
|||
|
|||
|
Yeah, I was hoping I would get an error string returned or something if the execution failed due to the database constraint violation... Anyhow, after studying up on the error object some more I got it figured out. I printed out the error number associated with the constraint violation and now check to see if that error is generated and handle it if it is. Thanks though.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > display error message on constrain violation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|