具体情况如下:
实现:1、通过clientdataset的commandtext动态改变所要查询的表,即:
想查表a就用select * from a,想查表b就用select * from b
2、手工获取大字段(blob字段)
服务器端:
远程数据模块 RDM 中有query和datasetprovider;
datasetprovider的poallowcommandtext为true
pofetchblobsondemand为true(需手工获取blob字段)
客户端:有socketconnection,clientdataset;
clientdataset的remoteserver为socketconnection;
providername为RDM.datasetprovider
fetchondemand为false;(blob字段不自动打包)
afterscroll中调用fetchblobs(获取blob字段)
这样在调用 clientdataset.commandtext:='select * from a';
clientdataset.open;
时就出错 record not found or changed by other user
主要问题还是在fetchblobs,要是不调用这句的话就没问题,但这样没法获取blobs字段,请问高手应如何解决? 先谢谢了!
实现:1、通过clientdataset的commandtext动态改变所要查询的表,即:
想查表a就用select * from a,想查表b就用select * from b
2、手工获取大字段(blob字段)
服务器端:
远程数据模块 RDM 中有query和datasetprovider;
datasetprovider的poallowcommandtext为true
pofetchblobsondemand为true(需手工获取blob字段)
客户端:有socketconnection,clientdataset;
clientdataset的remoteserver为socketconnection;
providername为RDM.datasetprovider
fetchondemand为false;(blob字段不自动打包)
afterscroll中调用fetchblobs(获取blob字段)
这样在调用 clientdataset.commandtext:='select * from a';
clientdataset.open;
时就出错 record not found or changed by other user
主要问题还是在fetchblobs,要是不调用这句的话就没问题,但这样没法获取blobs字段,请问高手应如何解决? 先谢谢了!
建议要改变clientdataset时,直接edit,然后post再传到服务端,更新服务端TProvider。
或者直接调用服务端的方法,执行更新SQL命令
这些都没问题,我用dbgrid都可以显示出来呀,就是在调用fetchblobs来获取当前记录的
blobs字段时才出错的谢谢两位了,很奇怪,昨天不知怎么搞的又没这个问题了。但是还有个新问题:就是在主窗口
的oncreate中把clientdataset的afterscroll改为自定义过程,即:DM.clientdataset.afterscroll:=aftermyscroll,而在aftermyscroll中调用(dataset as TClientdataset).fetchblobs时又出现这个问题,请帮忙看一下好吗
并且为query的FieldList加入所有的字段,将主关键字段的 ProviderFlag.pfInKey设为True
即可。