问题: 数据库查询 ID>n 的所有记录
描述:

数据库查询  ID>n  的所有记录,咋写?  (n=整数)
adoquery.SQL.Add('select *  from   余额表 where ID> n   order by ID ASC');
这么写对么?


解决方案1:

adoquery.SQL.Add('select *  from   余额表 where ID> n   order by ID ASC');
SQL语句错误,N不能直接带入,它要转化成字符形式,修改


var S:string;
S:=IntToStr(N);
adoquery.SQL.Add('select *  from   余额表 where ID>'+#39+S+#39+' order by ID ASC');

试试,应该解决问题。

上一篇关于从服务器下载数据的问题
下一篇连接sql数据库两种方式出现的问题
明星图片
相关文章
《 数据库查询 ID>n 的所有记录》由码蚁之家搜集整理于网络,
联系邮箱:mxgf168#qq.com(#改为@)