Y
yuol
Unregistered / Unconfirmed
GUEST, unregistred user!
我开发三层应用程序,使用'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
补充:是不是与服务端TDataSetProvider控件的Options属性有关?我只设置poAllowMultiRecordUpdates和poAllowCommandText为True,还有什么要设置为true???
编译环境:
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
补充:是不是与服务端TDataSetProvider控件的Options属性有关?我只设置poAllowMultiRecordUpdates和poAllowCommandText为True,还有什么要设置为true???