您的位置:首页 > 数据库

Delphi中SQL语句配置参数代码示例

2008-08-26 14:48 477 查看
function Tformmain.UpdateUsercardFlag(dsjbh,qh,uphone:string):boolean;//更新用户号码簿中的检查标志

begin

try

with QryTemp do begin

if Active then close;

sql.Clear;

// select dsjbh,qh,uphone,zjtype,uzjsj,checkflag from user_card

sql.Text:='update user_card set checkflag=1 where'

+' dsjbh=:dsjbh and uphone=:phone and qh=:qh';

Parameters.ParamByName('dsjbh').Value:=dsjbh;

Parameters.ParamByName('phone').Value:=uphone;

Parameters.ParamByName('qh').Value:=qh;

ExecSQL;

end;

result:=true;

except

ADOConnection1.Close;

StatusBar1.Panels[2].Text:='更新失败';

sleep(200);

result:=false;

end;

end;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: