使用query添加sql语句插入非字符数据使用动态参数出现类型不匹配
如:
query1.close;
query1.sql.clear;
query1.sql.add ('insert into student(socore) values(:aa)');
query1.params[0].values=80;
query1.execsql
出现类型不匹配
如:
query1.close;
query1.sql.clear;
query1.sql.add ('insert into student(socore) values(:aa)');
query1.params[0].values=80;
query1.execsql
出现类型不匹配
解决方案 »
- delphi 问题
- 系统热键调用隐藏窗体
- Delphi7编译时的一个怪问题,不知有没人遇到过?
- 我所遇见fastreport的报表超级难题,在3.0里行不通!
- 是他叫着要分的,不关我的事情。我也没办法;
- 请教一个Sql语句的写法!
- 如何阻止dxdbgrid处于编辑状态时失去焦点时自动更新数据集??
- 我如何在程序运行的时候获取整个局域网中的sqlserver2000服务器,以及其中包含的数据库呢??
- 求函数,直接取出月份,年份,不要用copy()
- delphi中调用外部应用程序的方法有几种?有没有可以带参数的方法?
- 最后的散分十,先到先得。
- 用Delphi7实现多个文件夹的复制与粘贴(自由选择路径)急用!!!
query1.parambyname('aa').AsString := 80;
query1.execsql;query1.params[0].values=80
=???!
query1.sql.clear;
query1.sql.add ('insert into student(socore) values( Inttostr('+aa+')');
query1.execsql;
query1.params[0].values=80 是给这个参数赋成绩等于80分
query1.sql.clear;
query1.sql.add ('insert into student(socore) values('+Inttostr(aa));
query1.execsql;
不好意思,刚才写错了.
query1.close;
query1.sql.clear;
query1.sql.add ('insert into student(socore) values('+ Inttostr(aa)+')');
query1.execsql;