Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Exception

0 views
Skip to first unread message

Kjetil Thue

unread,
Mar 16, 2000, 3:00:00 AM3/16/00
to
Hello
I have a problem with INSERT . When duplicate "primary key" values a
error is generated and the application crases. I want to catch this in
an exception. I have tried this:

try
{
Query1->SQL->Clear();
Query1->SQL->Add("INSERT INTO tbl_message VALUES(" + msgId + ", \'"
+ timeStamp + "\', " + Priority + ", " + DbRecP + ", " + DbSendP
+ ", "
+ RecId + ", " + SendId + ", \'" + MainMsg + ") ");
Query1->ExecSQL();
}
catch (const EDatabaseError &DatabaseError)
{
ShowMessage(DatabaseError.Message.c_str());
}

This catches the DatabaseError but the application stil crashes. How can
I change this. I don't want my application to crash?

Thanks
Kjetil


Thorsten Schmidt

unread,
Mar 18, 2000, 3:00:00 AM3/18/00
to
> This catches the DatabaseError but the application stil crashes. How
can
> I change this. I don't want my application to crash?

Where does the application crash, while executing the catch block or
after the catch block?

Thorsten.

0 new messages