Get Type of SQL Errors?
If an SQL query error occurs, is there way to detect what type of error it was? Here are the two basic things I need to detect.
1. A SELECT, UPDATE, DELETE querys:
a) It worked, all went well
b) Could not find record
c) Something else...
2. A INSERT query:
a) It worked, all went well
b) Duplicate record (ID) found, could not insert
c) Something else...
I'm sure there is a specific code to find this out but it would probably differ between database types. So, I'm just either looking for a way to have vB tell me or if someone has a nice compiled list of error codes for the supported databases. Thanks
To add to the INSERT duplicate error, I'd also need to know if it was a non-unique field/record. I have ID and NAME which both need to be unique.
|