Autor Beitrag
Nico80
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39

WIN XP
DELPHI 2006
BeitragVerfasst: Fr 10.08.07 09:22 
Hallo an alle IBX oder DB-Experten,

wie wende ich einen Filter an?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
  DataSet.SelectSQL.Text := 'SELECT * FROM TABELLE ORDER BY id';
  DataSet.Prepare;

  for i := 0 to Count-1 do begin

    DataSet.Close;
    DataSet.Filtered := False;
    DataSet.Filter   := Format('ID=%d',[i]);
    DataSet.Filtered := True;
    DataSet.Open;

    if DataSet.RecordCount > 0 then begin
      ...    
    end;
  end;


Leier bekomme ich immer nur den erten DS zurueck.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 10.08.07 11:44 
es dürfte auch nur ein DS pro Id geben.

_________________
Markus Kinzler.
Nico80 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39

WIN XP
DELPHI 2006
BeitragVerfasst: Mo 13.08.07 07:56 
user profile iconmkinzler hat folgendes geschrieben:
es dürfte auch nur ein DS pro Id geben.


Scheint wohl nur bei TIBDataSet mit der Verwendung des Ereignises "OnFilterRecord" zu funktionieren.