🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
4 messages
4 total messages Started by Roger Cormier Fri, 20 Apr 2001 18:25
Catching a primary key error
#5477
Author: Roger Cormier
Date: Fri, 20 Apr 2001 18:25
5 lines
987 bytes
Hi there, I was wondering if there was an easy way to catch a primary key
error using ADO to access SQL Server 7...
Thanks for any help anyone can give me...

Roger Cormier
Re: Catching a primary key error
#5481
Author: Mark Cashman
Date: Sat, 21 Apr 2001 01:40
12 lines
1262 bytes
Hi, Roger!

Have you tried the OnPostError event of TADOQuery?

------
Mark Cashman (TeamB - C++ Builder), creator of The Temporal Doorway at
http://www.temporaldoorway.com
- Original digital art, writing, music and more -
C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
(Join us!)
http://www.temporaldoorway.com/programming/index.htm
------
Re: Catching a primary key error
#5496
Author: Roger Cormier
Date: Mon, 23 Apr 2001 16:04
23 lines
1640 bytes
That seems like it'll work...  Is there a way for me to tell if one of those
errors that it would catch there would be a primary key error though, so I
can display my own custom message to the user for this error?
Thanks...

Roger Cormier

"Mark Cashman" <mcashman@temporaldoorway.com> wrote in message
news:3AE0E500.82AA18E3@temporaldoorway.com...
> Hi, Roger!
>
> Have you tried the OnPostError event of TADOQuery?
>
> ------
> Mark Cashman (TeamB - C++ Builder), creator of The Temporal Doorway at
> http://www.temporaldoorway.com
> - Original digital art, writing, music and more -
> C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
> (Join us!)
> http://www.temporaldoorway.com/programming/index.htm
> ------
>
>
Re: Catching a primary key error
#5503
Author: Mark Cashman
Date: Wed, 25 Apr 2001 00:10
13 lines
1522 bytes
You should experiment with looking at the contents of the passed
EDatabaseError. I believe the message property should contain some text
that might be helpful; you could recognize it and produce whatever
message you want.

------
Mark Cashman (TeamB - C++ Builder), creator of The Temporal Doorway at
http://www.temporaldoorway.com
- Original digital art, writing, music and more -
C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
(Join us!)
http://www.temporaldoorway.com/programming/index.htm
------
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads