I'm using Zeos SVN 7378 on Delphi 2010 + Firebird 2.1 testing new behavior of TryKeepDataOnDisconnect property on datasets.
Considering the sequence of the code below, it causes the EZIBSQLException = -904 Message: isc_dsql_allocate_statement.
#1 - Connect the database and open the query with some properties
Code: Select all
procedure TForm1.btnOpenClick(Sender: TObject);
begin
if not ZConnection1.Connected then
ZConnection1.Connect;
if ZQuery1.Active then
ZQuery1.Close;
ZQuery1.CachedUpdates := true;
ZQuery1.TryKeepDataOnDisconnect := true;
ZQuery1.Open;
end;
Code: Select all
procedure TForm1.btnConnDisconnClick(Sender: TObject);
begin
if not ZConnection1.Connected then
ZConnection1.Connect
else
ZConnection1.Disconnect;
end;
Code: Select all
procedure TForm1.btnApplyUpdatesClick(Sender: TObject);
begin
if ZQuery1.UpdatesPending then
begin
if not ZConnection1.Connected then
ZConnection1.Connect;
ZQuery1.ApplyUpdates;
ZQuery1.CommitUpdates;
ZQuery1.Refresh;
end;
end;