Board index » cppbuilder » How do you catch errors & messages in ADO?
Vladimir Stefanovic
CBuilder Developer |
Vladimir Stefanovic
CBuilder Developer |
How do you catch errors & messages in ADO?2005-05-08 06:18:28 PM cppbuilder63 Hi, I asked this a couple of weeks before, but without an answer (Thread: TADOTable & TADOQuery: OnPost() errors...) How do you know what to say to the user when you catch some post/insert/delete error in ADO? I think that saying "Some error occured" is not fair. I do it now by analyzing the string in 'E->Message' (the more details with code is in my original thread). Is there anything better? -- Best regards, Vladimir Stefanovic |
Viatcheslav V. Vassiliev
CBuilder Developer |
2005-05-09 03:57:06 AM
Re:How do you catch errors & messages in ADO?
Try to examine TADOConnection::Errors collection. It contains error
numbers - both COM and native (that goes from db server). //------------------------------------------ Regards, Vassiliev V. V. www.managed-vcl.com - using .Net objects in Delphi for Win32 + ADO.Net www.oledbdirect.com - The fastest way to access MS SQL Server, MS Jet (Access) and Interbase (through OLEDB) "Vladimir Stefanovic" < XXXX@XXXXX.COM >сообщи?сообщила ?новостях следующе? news: XXXX@XXXXX.COM ... QuoteHi, |
Vladimir Stefanovic
CBuilder Developer |
2005-05-09 04:24:06 AM
Re:How do you catch errors & messages in ADO?
Thanks!
-- Best regards, Vladimir Stefanovic "Viatcheslav V. Vassiliev" < XXXX@XXXXX.COM >wrote in message QuoteTry to examine TADOConnection::Errors collection. It contains error {smallsort} |
George Nakos
CBuilder Developer |
2005-08-11 07:50:13 PM
Re:How do you catch errors & messages in ADO?
On Sun, 08 May 2005 22:57:06 +0300, Viatcheslav V. Vassiliev
< XXXX@XXXXX.COM >wrote: QuoteTry to examine TADOConnection::Errors collection. It contains error it's a bit difficult for me. I don't use too much C++, I guess it's a try/catch block, but I haven't been able to trap ADO errors. BTW: I'm new on the forum, good to be here :) Best regards, George Nakos -- Using Opera's revolutionary e-mail client: www.opera.com/mail/ |
poojo hackma
CBuilder Developer |
2005-11-22 01:07:16 AM
Re:How do you catch errors & messages in ADO?
George,
Did you ever get a response to this? If not, try something like this: try // this try closes the database if there are problems { try // this try catches your errors { ADOConnection1->Connect(); // do stuff with your connection } catch (Exception* ex) { MessageBox(NULL, ex->Message.c_str(), "DB Error", MB_OK); } } __finally { ADOConnection1->Close(); } "George Nakos" < XXXX@XXXXX.COM >wrote in message On Sun, 08 May 2005 22:57:06 +0300, Viatcheslav V. Vassiliev < XXXX@XXXXX.COM >wrote: QuoteTry to examine TADOConnection::Errors collection. It contains error it's a bit difficult for me. I don't use too much C++, I guess it's a try/catch block, but I haven't been able to trap ADO errors. BTW: I'm new on the forum, good to be here :) Best regards, George Nakos -- Using Opera's revolutionary e-mail client: www.opera.com/mail/ |
George Nakos
CBuilder Developer |
2005-11-22 06:46:52 PM
Re:How do you catch errors & messages in ADO?
On Mon, 21 Nov 2005 19:07:16 +0200, poojo hackma <poojo.com/mail>wrote:
QuoteGeorge, Using Opera's revolutionary e-mail client: www.opera.com/mail/ |