1。最常用的带参数查询:
query1.SQL.Add('Select * from tablename where fieldname =:myfield');
query1.ParamByName('myfield').AsString := trim(edit1.text);
query1.ParamByName('myfield').Asinteger := strtoint(trim(edit1.text));
2。匹配查询:
query1.sql.add('Select * from tablename where fieldname like "%'+Edit1.text+'%"');