Autor Beitrag
Björn karpenstein
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 96

Windows XP, Linux
D7, K3
BeitragVerfasst: Do 29.09.05 14:28 
Hallo!

Wie macht man denn eine Like-Suche mit Parametern im AdoQuery? Irgendwie steige ich da nicht so ganz dahinter:

Habs mal so

ausblenden Delphi-Quelltext
1:
2:
3:
frm.ADOQuery1.SQL.Add('WHERE email like %'+QuotedStr(':suchtext')+'%');
frm.ADOQuery1.SQL.Add('WHERE email like '+QuotedStr('%:suchtext%'));
frm.ADOQuery1.SQL.Add('WHERE email like %:suchtext%);


versucht aber irgendie ohne Erfolg was isn da richtig?

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.
Moderiert von user profile iconChristian S.: Topic aus VCL (Visual Component Library) verschoben am Fr 30.09.2005 um 15:40
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Fr 30.09.05 14:33 
Ganz normal 'Where foo like :Bar'. Aber den Parameter 'Bar' entsprechend setzen:
ausblenden Delphi-Quelltext
1:
Tables.ParamValues['Bar'] := '%'+aSuchString+'%'					

_________________
Na denn, dann. Bis dann, denn.
Björn karpenstein Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 96

Windows XP, Linux
D7, K3
BeitragVerfasst: Fr 30.09.05 17:26 
Und nochmal danke alzaimar :)