Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: Can\'t see error message
Can't see error message
Posted: 2007/11/16 02:46
 
Hi!

In my program, I have an adquery and an update sql component with fully writed sql commands, and if I try to delete/insert/update a record it isn't working. I wrote a fake sql command, and at runtime I can see the error message in the Anydac monitor, but in the Delphi application I can't get any error messages, or exceptions. What could be wrong?


Delphi7 / oracle10g /AnyDac 1.12.2

Robert
Re:Can't see error message
Posted: 2007/11/16 07:24
 
Hello

What command (better code sample) do you use to post updates to DB ?

Regards,
Dmitry
Re:Can't see error message
Posted: 2007/11/19 01:47
 
Hi!

Use componets in my test application.

ADConnection
ADGUIxWaitCursor
DBGrid
DataSource
ADQuery
ADUpdateSQL

Procedures

procedure TForm1.BtnAppendClick(Sender: TObject);
begin
ADConnection1.StartTransaction;
ADQuery2.Append;

end;

procedure TForm1.BtnStopTranClick(Sender: TObject);
begin
ADQuery2.ApplyUpdates;
ADQuery2.CommitUpdates;
ADConnection1.Commit;
end;

The ADQuery is connected with the ADUpdateSQL component. I use only the Insert event of the ADUpdateSQL in my example. If there is no error in the Insert SQL then the transaction are completing successfully, but if I make intetionally a mistake in the SQL statement (for example I use a non existent table name, or a non existent field name) then I don't get any error message, and of course the transaction also doesn't complete. The new record is visible in the DBGrid, until I reopen the ADQuery. Could you help me, what is the problem, why I don't get any error message?

In the ADMonitor Oracle error is visible.

Thanks for your help.

Best regards:
Robert

Post edited by: KRobert, at: 2007/11/19 02:04
Re:Can't see error message
Posted: 2007/11/19 06:00
 
Hello

You should use ApplyUpdates(0). The parameter means, how many errors may happen before AppluUpdates will be terminated.

Regards,
Dmitry
Re:Can't see error message
Posted: 2007/11/19 06:38
 
Hi!

Thanks for your answer, but it seems, it doesn't work. I modified the code as you can see below, but nothing has changed. Have you got any idea?

procedure TForm1.BtnStopTranClick(Sender: TObject);
begin
ADQuery2.ApplyUpdates(0);
ADQuery2.CommitUpdates;
ADConnection1.Commit;
end;


Thanks: Robert