Autor Beitrag
jjturbo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Do 26.04.12 15:16 
Moin Forum,

ich habe hier ein altes Projekt, in einem TTable wird ein Filter gesetzt und anschliessend per Locate ein Datensatz gesucht. Locate findet ihn nicht, obwohl er vorhanden ist. Zumindest sieht es für mich so aus.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
  FilterStr := '(PROFILTYP='+QuotedStr(PFT)+') and (FARBE='+QuotedStr(Farbe)+')'+
               ' and (PARTNER= '+QuotedStr('00000000')+')';

  HauptForm.KopfdatenTable.Filtered:=false;
  HauptForm.KopfdatenTable.Filter:=FilterStr;
  HauptForm.KopfdatenTable.Filtered:=True;
  HauptForm.KopfdatenTable.Refresh;


  while HauptForm.KopfdatenTable.Locate('Stab;Fertig',VarArrayOf([0'']), [loCaseInsensitive]) do begin
    ...
  end;

Es scheint irgendwie an diesem Filter zu hängen, dieselbe Funktion wird auch mit diesem Filter aufgerufen:
ausblenden Delphi-Quelltext
1:
2:
  FilterStr := '(PROFILTYP = '+QuotedStr(PFT)+' and FARBE = '+QuotedStr(Farbe)+
               ' and BAHN_NR = 2)';


Damit gehts. Es handelt sich hier um ein älteres Projekt, Tabelle ist dBase. Das Feld Partner ist ein C,8 Zeichen lang. Also sollte eigentlich alles ok sein.

Jemand eine Idee?

Danke im voraus, Gruß Oliver

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
Tranx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 648
Erhaltene Danke: 85

WIN 2000, WIN XP
D5 Prof
BeitragVerfasst: Fr 27.04.12 12:28 
Hast Du denn wirklich einen Datensatz mit dem Eintrag '00000000' in Partner? Die anderen Filtereinträge sind mit Parametern belegt, nur Partner ist ein Festwert. Locate würde ja nur den Datansatz/die Datensätze ausgeben, welche in allen drei Filterkriterien stimmen (wegen der AND-Verknüpfung).

_________________
Toleranz ist eine Grundvoraussetzung für das Leben.
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Fr 27.04.12 13:55 
Ja, den Eintrag "00000000" gibt es(mehrmals).

Aber das Problem ist wohl das Feld "Fertig": Wenn ich Das mit "n" befülle und mit Locate nach
Locate('Stab;Fertig', VarArrayOf([0'n'])
suche, dann geht es auch.

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...