Recordcount not working in datasource.dataset
Posted: Tue 25 Nov 2008 16:00
I have a baseform with this code
If I create a new form with the baseform inherited, my datasource checked witch button must me enabled. It works with TMyQuery, but TVirtualTable gives 'recordcount = 0' in this procedure. This is not correct.
I know, because in the childform the recordcount of TVirtualtable shows the correct recordcount.
I'm using TVirtualTable in MyDAC 5.570.0.42 with D2009 pro
Code: Select all
procedure TBasisFormFld.DataSource1StateChange(Sender: TObject);
begin
with DataSource1.DataSet do
begin
TlBtnNieuw.Enabled := (State in [dsBrowse, dsInactive]);
TlBtnEdit.Enabled := (State = dsBrowse) and (RecordCount > 0);
TlBtnPost.Enabled := State in [dsInsert, dsEdit];
TlBtnDelete.Enabled := (State = dsBrowse) and (RecordCount > 0);
TlBtnRecRew.Enabled := (State = dsBrowse) and (RecordCount > 0);
TlBtnRecForward.Enabled := (State = dsBrowse) and (RecordCount > 0);
TlBtnZoekModus.Enabled := (State in [dsBrowse, dsInactive]);
TlBtnZoekGevonden.Enabled := (State in [dsBrowse, dsInactive]);
end;
end;
I know, because in the childform the recordcount of TVirtualtable shows the correct recordcount.
I'm using TVirtualTable in MyDAC 5.570.0.42 with D2009 pro