DataModule2.ADOQuery1.SQL.Add('SELECT Password FROM Users WHERE login ='+#39+Edit1.Text+#39);
DataModule2.ADOQuery1.Open;
<b>ShowMessage(DataModule2.ADOQuery1.SQL.Text);</b>
if DataModule2.ADOQuery1.IsEmpty then
ShowMessage('Пользователь не найден!')
else
SELECT * FROM table WHERE name LIKE 'Timmi'