I am trying to insert the record using ADO, when the record already exists I
get error msg something like this

Err.description = "[Sybase][ODBC Driver][Adaptive Server Anywhere]Primary
key for table 'Table1' is not unique"
err.number = -2147217900

I want to trap this and formulate better error message. WHats the best way
to do...is the error number here unique number (-2147217900)

Thanks

Re: VBScript error -2147217900 by Anthony

Anthony
Thu Mar 29 03:29:28 CDT 2007


"abcd" <abcd@abcd.com> wrote in message
news:uQpz0mXcHHA.4836@TK2MSFTNGP03.phx.gbl...
> I am trying to insert the record using ADO, when the record already exists
I
> get error msg something like this
>
> Err.description = "[Sybase][ODBC Driver][Adaptive Server
Anywhere]Primary
> key for table 'Table1' is not unique"
> err.number = -2147217900
>
> I want to trap this and formulate better error message. WHats the best way
> to do...is the error number here unique number (-2147217900)
>

No. In Hex the error is 80040E14. 8004 means error (8) in the Interface
facility (4). There is no guarantee that other interfaces (i.e., entirely
difference objects from ADO) won't also use the exact same error number to
mean completely different things. Further E14 = 3604 coming from ADO can
mean a number of things search google for 'Error 3604 ADO'. All seem to be
related to an attempt to duplicate something that should be unique.




Re: VBScript error -2147217900 by abcd

abcd
Thu Mar 29 14:52:48 CDT 2007

Thanks.

I solved my issue by cheking connection objects error collection and
checking for Native Error.


Anthony Jones wrote:
> "abcd" <abcd@abcd.com> wrote in message
> news:uQpz0mXcHHA.4836@TK2MSFTNGP03.phx.gbl...
>> I am trying to insert the record using ADO, when the record already
>> exists I get error msg something like this
>>
>> Err.description = "[Sybase][ODBC Driver][Adaptive Server
>> Anywhere]Primary key for table 'Table1' is not unique"
>> err.number = -2147217900
>>
>> I want to trap this and formulate better error message. WHats the
>> best way to do...is the error number here unique number (-2147217900)
>>
>
> No. In Hex the error is 80040E14. 8004 means error (8) in the
> Interface facility (4). There is no guarantee that other interfaces
> (i.e., entirely difference objects from ADO) won't also use the exact
> same error number to mean completely different things. Further E14 =
> 3604 coming from ADO can mean a number of things search google for
> 'Error 3604 ADO'. All seem to be related to an attempt to duplicate
> something that should be unique.