Autor Beitrag
Robert.Wachtel
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 895
Erhaltene Danke: 7

Windows 7 Ultimate x64
D5 Ent, D7 Arch, RAD Studio 2010 Pro, VS 2008
BeitragVerfasst: Di 11.03.08 10:31 
Wie user profile iconalzaimar schon ganz richtig sagte: Grundlagen! Du kannst doch nicht programmieren wollen ohne auch die einfachsten Grundlagen lernen zu wollen...

Du kannst Strings nicht mit einem logischen Oder verknüpfen und das Ergebnis dann auch noch einem String zuweisen. Das OR ist doch Teil des Filterausdrucks:

ausblenden Quelltext
1:
ADOTable1.Filter := '(Bezeichnung='+ QuotedStr(Edit1.Text) + ') or (' + 'ICAO='+ QuotedStr(Edit1.Text) [...]					
Fliegerbenny Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: Di 11.03.08 10:42 
Es hat funktioniert!!! Ich danke euch!

Ich werde mal in Bibliothek stampfen und mir ein Grundlagen Buch besorgen ;)

DANKE

Benny
zuma
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 660
Erhaltene Danke: 21

Win XP, Win7, Win 8
D7 Enterprise, Delphi XE, Interbase (5 - XE)
BeitragVerfasst: Di 11.03.08 11:14 
der Filter ist meines Erachtens nicht richtig:

Versuchs mal so:
leg dir ne zwischenvariable vom Typ String an:
ausblenden Quelltext
1:
var lTmpStr : String;					


und befülle sie so:
ausblenden Quelltext
1:
2:
3:
4:
lTmpStr := Format('Bezeichnung= ''%s'' or ICAO= ''%s'' or IATA= ''%s'' or Rufname= ''%s'' or Land= ''%s''', [QuotedStr(Edit1.Text)]);

ADOTable1.Filter := lTmpStr;
ADOTable1.Filtered := true;


wobei ich mir nicht sicher bin, ob das %s in doppelte Hochkomma gefaßt werden muss oder nicht (evtl. einfach mal die Hochkomma vor und nach einem %s weglassen

_________________
Ich habe nichts gegen Fremde. Aber diese Fremden sind nicht von hier! (Methusalix)
Warum sich Sorgen ums Leben machen? Keiner überlebts!
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Di 11.03.08 13:32 
@zuma: So isses besser:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
Const
  sFilter = '(Bezeichnung=%0:s= or (ICAO=%0:s) or (IATA=%0:s) or (Rufname=%0:s) or (Land= %0:s)';

Begin
  MyTable.Filter := Format (sFilter,[QuotedStr(Edit1.Text)]);
  MyTable.Filtered := True;
...

_________________
Na denn, dann. Bis dann, denn.
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Di 11.03.08 13:37 
user profile iconalzaimar hat folgendes geschrieben:
@zuma: So isses besser:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
Const
  sFilter = '(Bezeichnung=%0:s) or (ICAO=%0:s) or (IATA=%0:s) or (Rufname=%0:s) or (Land= %0:s)';

Begin
  MyTable.Filter := Format (sFilter,[QuotedStr(Edit1.Text)]);
  MyTable.Filtered := True;
...


[/edit:] Syntaxerror in Line 2[/edit]

_________________
Na denn, dann. Bis dann, denn.