habt vielen Dank

ich werde dahingehend die Abfrage ändern, falls es noch Probleme geben sollte, melde ich mich noch einmal,
noch eine andere Frage. Gibt es hier im Forum die Delphi - Formatierung? also mit Tab oder Leerzeichen?
Weil wenn alles untereinander steht sieht das dumm aus. ^^
Über dem Text, den Du eingibts, ist eine Reihe von Symbolen, u. a. ein Delphisymbol. (das 16. von links?) Es erscheint beim Mitdermausdrüberfahren der Hinweis: Delphi-Code einfügen.
Dadrauf klicken und dann an der Cursorposition den Quelltext einfügen.
Per Copy&Paste bleibt die Formatierung erhalten.
Könnte dann in etwa so aussehen:
Delphi-Quellcode:
procedure TDataMod.SQL_LIKE_TBLSearch(
AConnection:TADOConnection;
ATblName:WideString;
arr_TBLCols:array of string;
arr_TBLValues:array of string;
APK:string;
var AResultList:TStringList
);
var AQuery:TADOQuery;
ASQLTemp:string;
ix:integer;
ASQL_Default:string;
begin
{SELECT STAEDTE.ID_STADT, STAEDTE.STADT_NAME
FROM STAEDTE
WHERE (([STAEDTE]![STADT_NAME] Like "%Mark"));}
if AConnection <> nil then begin
if Trim(ATblName) <> EmptyWideStr then begin
if Length(arr_TBLCols) > 0 then begin
if Length(arr_TBLValues) > 0 then begin
if Length(arr_TBLCols) = Length(arr_TBLValues) then begin
if TblExists(AConnection,ATblName) then begin
AQuery:=TADOQuery.Create(Self);
try
ASQLTemp := 'SELECT * FROM' + fConstants.BLANK1 +
ATblName + fConstants.BLANK1 +
'WHERE' + fConstants.BLANK1;
ASQL_Default := ASQLTemp;
for ix := Low(arr_TBLCols) to High(arr_TBLCols) do begin
if (Trim(arr_TBLCols [ix]) <> EmptyStr)
and (Trim(arr_TBLValues[ix]) <> EmptyStr) then begin
if Length(arr_TBLCols) = 1 then begin
ASQLTemp := ASQLTemp + '[' + ATblName +']![' + arr_TBLCols[ix] + ']' + fConstants.BLANK1
+ 'LIKE' + fConstants.BLANK1 + fConstants.AnfZeichen + arr_TBLValues[ix] + '%' + fConstants.AnfZeichen;
end else begin
if ix < High(arr_TBLCols) then begin
ASQLTemp := ASQLTemp + '[' + ATblName +']![' + arr_TBLCols[ix] + ']' + fConstants.BLANK1 +
'LIKE' + fConstants.BLANK1 + fConstants.AnfZeichen + arr_TBLValues[ix] + fConstants.AnfZeichen + fConstants.BLANK1 + 'AND' + fConstants.BLANK1;
end else begin
if ix = High(arr_TBLCols) then
ASQLTemp := ASQLTemp + '[' + ATblName +']![' + arr_TBLCols[ix] + ']' + fConstants.BLANK1 +
'LIKE' + fConstants.BLANK1 + fConstants.AnfZeichen + arr_TBLValues[ix] + fConstants.AnfZeichen;
end;
end;
end;
end;
if ASQLTemp <> ASQL_Default then begin
AQuery.Connection := AConnection;
AQuery.SQL.Add(ASQLTemp);
AQuery.Open;
AQuery.First;
while not(AQuery.Eof) do begin
AResultList.Add(AQuery.FieldByName(fConstants.TBL_ TOWN_ID).AsString);
AQuery.Next;
end;
AQuery.Close;
end;
finally
AQuery.Free;
end;
end;
end;
end;
end;
end;
end;
end;