我开发三层应用程序,使用'select count(*) as c1 from table'获取表的记录数,执行通过,但是要取出数据时报错。另据测试,sql中含有表达式的都出现同样情况,试问:这是程序设置出错还是这种方法本来就是不可行的?编译环境:
delphi 7
oracle 8i
windows 2000具体编码如下:
WebConnection1.open;
ClientDataSet1.close;
ClientDataSet1.commandtext:='select count(*) as c1 from table';
ClientDataSet1.open;
edit1.text:=ClientDataSet1.fieldbyname('c1').asstring;
ClientDataSet1.close;
WebConnection1.close;
运行错误:value of field 'c1' is out of range
delphi 7
oracle 8i
windows 2000具体编码如下:
WebConnection1.open;
ClientDataSet1.close;
ClientDataSet1.commandtext:='select count(*) as c1 from table';
ClientDataSet1.open;
edit1.text:=ClientDataSet1.fieldbyname('c1').asstring;
ClientDataSet1.close;
WebConnection1.close;
运行错误:value of field 'c1' is out of range
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货