首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ Builder >

这个SQL 语句为什么不对? ()

2012-03-03 
这个SQL 语句为什么不对?? (在线等)str updatequotittablesetstepvalue +FloatToStr(_coefit2)+ wher

这个SQL 语句为什么不对?? (在线等)
str= "update   quotittable   set   stepvalue= "+FloatToStr(_coefit2)+ "where   freqytype= ' "+type+ " 'and   step= "+IntToStr(a)+ "and   chanleno= "+no;
                fmanage.UpdateFileinfor(str);

freqytype   为文本型   其他都为   数字型

[解决办法]
str= "update quotittable set stepvalue= "+FloatToStr(_coefit2)+ " where freqytype= ' "+type+ " 'and step= "+IntToStr(a)+ " and chanleno= "+no;
fmanage.UpdateFileinfor(str);

注意空格

可以输出str出来看看
[解决办法]
sql语法错误编译看不出错误,按照楼上说的将str输出看看那里出错了,再修改。
[解决办法]
1、where前面需要加一个空格
2、stepvalue字段是否是字符串的,需要在值两边加单引号,转义字符\开路
str= "update quotittable set stepvalue=\ ' "+FloatToStr(_coefit2)+ "\ ' where
[解决办法]
str= "update quotittable set stepvalue= "+FloatToStr(_coefit2)+ " where freqytype= ' "+type+ " 'and step= "+IntToStr(a)+ " and chanleno= "+no;


ShowMessage(str);(或者输出到文件中)


fmanage.UpdateFileinfor(str);

热点排行