Board index » delphi » SQL Error 13059 (Re-Post)

SQL Error 13059 (Re-Post)

Hi

How can I identify instances of "General SQL Error 13059"
where the cause is an attempt to insert a record which would
create a duplicate value in a key or index?

I want to be able to ignore these errors and carry on.

Does any part of edbengineerror such as Category or Sub Code
hold this information perhaps?

Using Delphi 5 pro, Access 97, BDE 5.11.

Thanks for any assistance.

MD

 

Re:SQL Error 13059 (Re-Post)


Quote
>Does any part of edbengineerror such as Category or Sub Code
>hold this information perhaps?

Why don't you just put some code and a break point in the OnpostError event and
check it for your self?
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:SQL Error 13059 (Re-Post)


Quote
>>Does any part of edbengineerror such as Category or Sub Code
>>hold this information perhaps?

Thanks for your response.

Quote
>Why don't you just put some code and a break point in the OnpostError event and
>check it for your self?

No problem. But doesn't 13059 cover other errors as well?

Apart from the message string, how do I know that a duplicate
is the problem? I must be missing something obvious here.

Regards

MD

Re:SQL Error 13059 (Re-Post)


Quote
>No problem. But doesn't 13059 cover other errors as well?

I don't know I just don't spend my time memorizing Access Error codes.  And by
the lack of response to the other times you have posted this message no one else
does either.

Quote
>Apart from the message string, how do I know that a duplicate
>is the problem? I must be missing something obvious here.

An EdbEgineError is a collection of errors which have properties
Category
ErrorCode
Message
NativeError
SubCode

You need to set up a situation where you create a duplicate record then post it
and have code in the onPostError event that allows you to trap these values.
Then take your best guess at which ones to use in your error trapping code

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:SQL Error 13059 (Re-Post)


Quote
>You need to set up a situation where you create a duplicate record then post it
>and have code in the onPostError event that allows you to trap these values.
>Then take your best guess at which ones to use in your error trapping code

Thanks

MD

Other Threads