AdoQuery1.Sql.Text:='select password from table1 where username=:un'; AdoQuery1.ParamByName('un').AsString:=username1; AdoQuery1.Open; if AdoQuery1.RecordCount<>0 then begin MyPassword:=AdoQuery1.FieldByName('password').AsString; if MyPassword=MaskEdit1.Text then ..... else ..... end; AdoQuery1.Close;
AdoQuery1.ParamByName('un').AsString:=username1;
AdoQuery1.Open;
if AdoQuery1.RecordCount<>0 then
begin
MyPassword:=AdoQuery1.FieldByName('password').AsString;
if MyPassword=MaskEdit1.Text then
.....
else
.....
end;
AdoQuery1.Close;