Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i get error messages provided from database errors?

Status
Not open for further replies.

marcela24

Programmer
Feb 17, 2003
72
NL
For example, this is what iam trying to do:

conn.execute ("insert into ....")
if error then
Response.write("Insert error")
Response.end()
end if

I remember that in PHP with postgres i do something like this:
pg_exec ("insert into...") or die ("Insert Error")
 
The connection object has it's own seperate error collection you can check:
Code:
If conn.errors.count > 0 Then
   Response.Write "Insert Error"
   Response.End
End If

-Tarwn 01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Another way to do this will be:

on Error Resume Next
err.clear()

--put code here, if something goes wrong (even during the DB part an error number will be generated )

--

if err.number <> &quot;0&quot; then
--put error handling here
end if


Personally I don't like to use &quot;on Error Resume Next&quot; but it's your'e choice Office notice: The beatings won't stop until morale improves
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top