delphi字符串拼接 qry1.SQL.Add('insert into T_user (id,username,password,count) values ('+id+','''+name+''','''+pwd+''',0)');id是int类型的,name,pwd是字符串类型,哪位大哥帮我看下 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 qry1.SQL.Add('insert into T_user (id,username,password,count) values ('+id+','''+name+''','''+pwd+''',0)');修改为:qry1.SQL.add('insert into T_user (id,username,password,count) values (+id+','+quotedstr(trim(name))+','+quotedstr(trim(pwd))+',0)' '); IntToStr(id),用以用Quotedstr()函數處理單引號qry1.SQL.Add('insert into T_user (id,username,password,count) values ('+IntToStr(id)+','+Quotedstr(name)+','+Quotedstr(pwd)+',0)'); qry1.SQL.Add('insert into T_user (id,username,password,count) values ('+inttostr(id)+','#39+name+#39','#39+pwd+#39',0)');遇见在字符串中 需要输入单引号,我喜欢用#39代替 qry1.SQL.Add('insert into T_user (id,username,password,count) values ('+IntToStr(id) +','+name+','+pwd+',0)');我这样应该是对的吧 如何激活combobox,并且获得item中的值,谢谢 关于DBGridEh的问题 送人 请问数组可以当参数传递吗? 寻求兼职(成都) delphi的小问题 我的实现修改保存对话框的保存按钮的CAPTION成备份(&B)的这段代码为什么不管用? 请问如何让一个控件放到另一个控件的下面.谢谢. 如何写测试样例`````` 急呀,请教一下,窗体间如何进行变量值的传递???? quickreport中对beforeprint,afterprint事件用法 delphi 做电子签名
修改为:
qry1.SQL.add('insert into T_user (id,username,password,count) values (
+id+','+quotedstr(trim(name))+','+quotedstr(trim(pwd))+',0)' ');