D,

ADO Errors Object unfortunately summarises the providor errors
see http://msdn.microsoft.com/library/psdk/dasdk/mdao4sky.htm

This is the problem with the OLE DB provider with MDAC 2.1 it provided
nothing (well actually 'Error Occurred')

 When I tried to insert a NULL field to a non null field the
ADOConnection.Errors[i].NativeError returns 3621  -
The statement has been terminated

But my xCase RI Trigger (which uses an user error 30001) returned an
informative NativeError

Description = Cannot insert child in "Quote" as its Foreign Key does not
exist in "Consultant".
Source = Microsoft OLE DB Provider for SQL Server
Number = -2147467259
SQLState = table
NativeError = 30001

You could prob get better info of the 'Native Errors' from the OLE DB object
but I can work out how to access it from the ADOConnection
(do you know?)

Answer is you are at the mercy of the OLE DB provider and ADO!

I just server side all the errors - but I want to be able to client side
popup an error desription and Corrective action so I'll be
using the native error - it would be nice to handle the primitive errors
(such as null) but they a pretty self explainatory so why worry!

P.S

What is TADOConnection.dbDatabaseInfoMessage()?

Regards
Neven


----- Original Message -----
From: Donovan J. Edye <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Wednesday, 1 March 2000 10:47
Subject: RE: [DUG]: Best Error Handling Strategy for ADO & SQL7....


> N,
>
> Well I was wondering about the TADOConnection.dbDatabaseInfoMessage().
> Should that be used instead of EADOError??
>
> Say I am attempting to trap a foreign key violation. The only way to
> determine the error number returned by SQL7 is to parse the string. Seems
> rather messy.
>
> Perhaps a better question is. Can you give me sample of your code to show
me
> how you deal with errors??
>
> TIA
>
> ------------------------------------------------------------------------
> --Donovan
> Donovan J. Edye [www.edye.wattle.id.au]
> Namadgi Systems, Delphi Developer
> Web: www.namsys.com.au E-Mail: [EMAIL PROTECTED]
> Voice: +61 2 6285-3460 Fax: +61 2 6285-3459
> TVisualBasic = Class(None);
> ------------------------------------------------------------------------
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Neven MacEwan
> Sent: Wednesday, 1 March 2000 08:21
> To: Multiple recipients of list delphi
> Subject: Re: [DUG]: Best Error Handling Strategy for ADO & SQL7....
>
>
> Donovan
>
> What do you want to achieve? Currently it raises an exception
>
> Regards
> Neven
>
> ----- Original Message -----
> From: Donovan J. Edye <[EMAIL PROTECTED]>
> To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
> Sent: Tuesday, 29 February 2000 18:47
> Subject: [DUG]: Best Error Handling Strategy for ADO & SQL7....
>
>
> > G'Day,
> >
> > Can someone please suggest the most robust error handling mechanism for
> ADO
> > & SQL7? Should I merely be trapping EADOError exceptions or is there a
> > better way?? Say for instance I would like to trap a foreign key
violation
> > (Error #547) what is the most elegant way to do this??
> >
> > TIA
> >
> > ------------------------------------------------------------------------
> > --Donovan
> > Donovan J. Edye [www.edye.wattle.id.au]
> > Namadgi Systems, Delphi Developer
> > Web: www.namsys.com.au E-Mail: [EMAIL PROTECTED]
> > Voice: +61 2 6285-3460 Fax: +61 2 6285-3459
> > TVisualBasic = Class(None);
> > ------------------------------------------------------------------------
> >
>
> --------------------------------------------------------------------------
> -
> >     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> >                   Website: http://www.delphi.org.nz
> >
>
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
>
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to