Delphi (5) and Interbase: TIBDataSet updating
Posted on 2003-03-09
I'm a newbee in using Interbase with Delphi (5). I have set up a FireBird SS in a Linux box and it works fine. Link with D5 using TIBDataBase, TIBTransaction and TIBQuery in a program:OK. Just one thing is very curious using a TIBDataSet. Filling in the diffrent SQL phrases for insert,delete, modify, select and refresh is not a problem, bur what really is boring me is that I can't set up an SQL sentence to update my table. The TIBDataSet is made of:
DeletSql:'delete from client where numero=:numero;' (numero is the primary key of the table)
ModifySQL:'update client set nomcomprime = :nomcomprime where numero = :old_numero";' (only one field is actually updated)
RefreshSQL='select * from client where numero=:old_numero;'
SelectSQL='select * from client where NOMCOMPRIME like 'C%';'
A grid is defined in the main form, the DataSource is linked to the DataSource in the DataForm, linked to the TIBDataSet. Basic processing is:
Show form: start transaction, open dataset. Data is correctly shown in the grid and corresponds to the selected subset.
A DBNavigator has been defined and linked to the same source the grid is linked.
Puxh update button, OK, data is updatable; field 'nomcomprime' is changed, modify button is pressed in the DBNavigator, the grid shows updated datafield. Great until now. When the Transaction is commited, in fact id seems to be rollback'ed.
procedure TF1.BCommitClick(Sender: TObject);
if DM1.IBTransaction1.InTransaction then
What's wrong ?
Thank you, folks.