ST3VO
asked on
Help Needed with TQuery SQL Error
Hi all,
I am having a problem with an SQL Query.
This is the code:
ADOQuery1.SQL.Add('select * from TheTable where (Make) = "' + (Edit1.Text) + '"');
Now...this wrks fine IF results are found but I get an error if there are no matches found.
How could I modify this so that IF there are no matches found I can do a Showmessage('No Matches Found') or something link this.
Hope you can help!
Thanks
ST3VO
I am having a problem with an SQL Query.
This is the code:
ADOQuery1.SQL.Add('select * from TheTable where (Make) = "' + (Edit1.Text) + '"');
Now...this wrks fine IF results are found but I get an error if there are no matches found.
How could I modify this so that IF there are no matches found I can do a Showmessage('No Matches Found') or something link this.
Hope you can help!
Thanks
ST3VO
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent!!! Worked Great! Thanks!
i.e.
if ADOQuery1.RecordCount > 0 then do
begin
etc