with Query1 do begin sql.Clear; sql.Add('select * 验证表 where 用户名="'+edit1.Text+'" and 密码="'+edit2.Text+'"'); Query1.Open; if (query1.recordcount >0) then 用户和密码正确结果就会大于0 然后 执行你要干的事