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