So müsste es ungefähr klappen:
Delphi-Quellcode:
procedure TForm1.Button2Click(Sender: TObject);
begin
test := Edit1.Text;
With Query1
Do
Begin
SQL.Text :=
'
SELECT *' + #10 +
'
FROM PLZCH' + #10 +
'
WHERE PLZ = :i_UserIDvar';
// Parse Statement um Variablen zu erkennen
Prepared := True;
// Parameterzuweisung
ParamByName('
i_UserIDvar').Value := Edit1.Text;
// Ausführen
Open;
Edit2.Text := FieldByName('
Ort').AsString;
Close;
end;
Greetz
alcaeus