I would suggest reading the details from the database first, rather than trying to do it in one step.
Code:
ADOQuery1->SQL_Text="select..."
// execute the query
// fetch, say into variable x
if (Edit1->Text == x)
// etc