Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: ADO error handling
tojo wrote:
>In article ... says...
>>
>> Can anyone tell me why error handlers not catcthing oracle unique
>> contraint errors?
[ snips ]
>A unique contraint error is provider-specific, not an ADO error. That
>means it won't cause a VB runtime error, and your ErrorHandler label
>will never be reached. You should either:
>
>1. Check your dbConnection.Errors collection right after you Execute
How do I access the error when its's actually breaking on the dbCommand.Execute. I tried this below but no joy, will it fire some event i'm unaware of?
dbCommand.Execute
MsgBox dbConnection.Errors.Item.Number
I actually want the insert to fail if it causes duplicates, but I don't want my program to fall over.
>2. Use the RecordsAffected parameter with Execute to make sure your
>insert succeeded.
Ok, never used that, sounds handy. Received on Thu Dec 05 2002 - 10:41:58 CST
![]() |
![]() |