问题: ClientDataSet.commandtext ( 积分: 100 )
分类: MIDAS / DCOM
来自: panjf, 时间: 2001-06-05 17:28:00, ID: 554949
我用
with ClientDataSet do begin
close;
commandtext:='select * from custom where name='+form1.Edit1.text;
open;
做查询,运行后提示ADODataSet1:Cannot perfrom this operation on an open dataset.
为什么?
我想用commandtext实现数据查询,如何做?
来自: silicon, 时间: 2001-06-05 17:32:14, ID: 554958
如果字段name是字符型的话应该这么写!
commandtext:='select * from custom where name='''+form1.Edit1.text + '''';
来自: 慕容乾坤, 时间: 2001-06-05 21:29:43, ID: 555229
你没有open
ClientDataSet.close;
ClientDataSet.commandtext:='...'
ClientDataSet.open;
来自: shsshashssha, 时间: 2001-06-06 8:13:50, ID: 555409
在应用服务器设置ADODataSet1.close
来自: Jamw, 时间: 2001-06-06 8:47:07, ID: 555451
delphi不是提示你“不允许对打开的数据库进行这项操作”嘛。关闭数据集就OK了。
来自: wind_cloudy, 时间: 2001-06-06 9:01:58, ID: 555476
将应用服务器的dataprovider的options中的poAllowCommandText设为true
来自: jswqg, 时间: 2001-06-07 8:33:12, ID: 557032
楼上说完了
来自: hunter0401, 时间: 2001-06-07 9:55:47, ID: 557163
1、设置客户端TClientDataSet的Dataprovider所使用的TDataprovider(指应用服务器)的poAllowCommandText为True;
2、TAdoQuery 的ACTIVE 为False;
来自: panjf, 时间: 2001-06-10 15:59:32, ID: 561262
我试了,可总提示
BOF或EOF中有一个“真“,或当前的记录已被删除,所需操作要求一个当前记录
为什么?
来自: wind_cloudy, 时间: 2001-06-11 11:20:08, ID: 561947
安装ADO补丁包#2
http://www.gzlove.net/download
来自: panjf, 时间: 2001-06-16 10:23:20, ID: 568921
》》TAdoQuery 的ACTIVE 为False
不就不能连数据库了吗?
来自: shsshashssha, 时间: 2001-06-16 11:08:00, ID: 568975
clientdataset.open会自动设置AdoQuery 的ACTIVE 为true;
使能下载数据
当AdoQuery 的ACTIVE 为true时,中间件数据集处于维护状态,不接受新的
clientdataset.commandtext
来自: davidlon, 时间: 2001-09-22 16:43:00, ID: 639534
[
![Smile :) :)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f642.png)
]安装ADO补丁包#2
来自: txmaster, 时间: 2001-09-23 8:43:00, ID: 640174
[
![Big Grin :D :D](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f600.png)
]我来总结一下:
1、服务器端
设TDataSetProvider的poAllowCommandText为True;
设与TDataSetProvider相连的数据集(TADODataset,TQuery等)的Active为False;[
![Big Grin :D :D](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f600.png)
]
2、在客户端查询时:
TClientDataSet.close;
TClientDataSet.commandtext:='';
TCLientDataSet.open;
来自: panjf, 时间: 2001-10-12 21:28:00, ID: 669782
多人接受答案了。
得分大富翁: davidlon-10,hunter0401-10,Jamw-10,jswqg-10,shsshashssha-10,silicon-10,txmaster-10,wind_cloudy-20,慕容乾坤-10,