时间:2021-07-01 10:21:17 帮助过:50人阅读
写法1:直接把变量值包含在sql的表达式中;
with frmDataPool.qry用户账号表 do begin Close; SQL.Text:=‘select * from 用户账号表 where admid = ‘ + QuotedStr(edtAdmid.Text) + ‘ AND admps = ‘ + QuotedStr(edtAdmps.Text); Open; end;
写法2:用参数
with frmDataPool.qry用户账号表 do begin Close; SQL.Text:=‘select * from 用户账号表 where admid = :admid AND admps =:admps ‘; Parameters.ParamByName(‘admid‘).Value:=edtAdmid.Text; //为admid参数赋值; Parameters.ParamByName(‘admps‘).Value:=edtAdmps.Text; //为admps参数赋值; Open; end;
数据集sql语句写法
标签:value str false 变量 语句 sql 赋值 logs 包含