把该表的字段全部添加到ADODataSet中(Add All Fields),然后再Create DataSet,这样你的ADODataSet就成为一个临时表了。可以通过Insert,Append,Edit,Delete去操作它
Recordset is the interface through which the records of an ADO dataset are accessed. When you open an ADO dataset, the value of Recordset is automatically set to the interface that provides access to the records. This value should not be used until after an OnRecordSetCreate event occurs.Use Recordset to get direct access to the ADO recordset object the dataset component represents. This direct access reference allows an application to use properties and methods of the underlying recordset object. Accessing the underlying recordset object is especially useful for utilizing properties and methods of the recordset object not surfaced in ADO dataset components.Ordinarily, an application would seldom need to access the underlying recordset object directly. One situation that would use such access is directing the recordset produced by the execution of a TADOCommand component. In these situations, assign the recordset returned by the Execute method (TADOCommand) directly to the Recordset property.ADODataSet1.Recordset := ADOCommand1.Execute;
如果已经使用'select * form MyTable'查到了所有的数据,那么数据就已经全部到了本地,这时用FILTER应该是比较好的方法. 如果一开始就是想读取部分满足条件的记录,不如使用'select * from MyTable where 条件'.这样网络上的数据流量是最小.应该比较好.
不可以,除非你不用ADODataSet,自己写一个数据集控件来支持SQL
李维《ADO/MTS/Com+》一书中说: 如果采用ADO,那么TADODataSet组件将是最主要的数据存取组件;而TADOQuery基本上与TADODataSet没有什么不同,但是TADOQuery可以处理SQL语句的DML语言,而TADoDataSet则无法执行,这是TADOQuery的前劲之处。我认为:TADODataSet还无法处理SQL语句中的DDL语句。 ---------------------------------------------------- 如果你要对ADODataSet进行操作,可以这样 //insert ADODataSet.Insert; ADODataSet['Field1'] := 'a'; ADODataSet['Field2'] := 'b'; ADODataSet['Field3'] := 'c';//update ADODataSet.First; while not ADODataSet.Eof do begin ADODataSet['Field1'] := 'hello world'; ADODataSet.Next; end;//delete ADODataSet.First; while not ADODataSet.Eof do ADODataSet.Delete;一句话: 用TADODATASET可以实现各种操作,只要你有足够的技巧
肯定不用用一些语句来处理了,要改用一些过程 比如: 不能: 'delete ADODataSet where value1=1'; 可以: ADODataSet.first; while not ADODataSet.eof do begin if ADODataSet.fieldvalues['value1']=1 then ADODataSet.delete else ADODataSet.next; end
你可以把数据自行保存,然后再loadfromfile出来使用;
如果一开始就是想读取部分满足条件的记录,不如使用'select * from MyTable where 条件'.这样网络上的数据流量是最小.应该比较好.
如果采用ADO,那么TADODataSet组件将是最主要的数据存取组件;而TADOQuery基本上与TADODataSet没有什么不同,但是TADOQuery可以处理SQL语句的DML语言,而TADoDataSet则无法执行,这是TADOQuery的前劲之处。我认为:TADODataSet还无法处理SQL语句中的DDL语句。
----------------------------------------------------
如果你要对ADODataSet进行操作,可以这样
//insert
ADODataSet.Insert;
ADODataSet['Field1'] := 'a';
ADODataSet['Field2'] := 'b';
ADODataSet['Field3'] := 'c';//update
ADODataSet.First;
while not ADODataSet.Eof do begin
ADODataSet['Field1'] := 'hello world';
ADODataSet.Next;
end;//delete
ADODataSet.First;
while not ADODataSet.Eof do ADODataSet.Delete;一句话:
用TADODATASET可以实现各种操作,只要你有足够的技巧
比如:
不能:
'delete ADODataSet where value1=1';
可以:
ADODataSet.first;
while not ADODataSet.eof do
begin
if ADODataSet.fieldvalues['value1']=1 then
ADODataSet.delete
else ADODataSet.next;
end
http://community.csdn.net/Expert/topic/3731/3731246.xml?temp=.3855554
wozhuchuanwei(一个组件编写者,就一定是一个更优秀的Delphi开发者) :我说的是两周内,两天也是两周内。请看清每个字。谢谢!dejiang(保龄球砸蚊子) 、gxgyj(杰克.逊)、Hunto(恶魔猎手) 、 hongchao(love) 、 Kshape(伟大的大伟//[现在的人发帖、一点分数含量都没有!])、 Sorder(剑客) :你们说的是过滤,我是要用到这个,但不完全是。题目是打个比喻,我有加where 条件,可能我说的还不够形象。但还是谢谢你们。
heluqing(鉴之小河) :我暂时还不知道你在说些什么,等会我再去看。看英文很花时间的。^-^stevetang(神力王):我97年是搞FoxBase的。已经很久不搞了。你猜错了,不过还是谢谢你帮我up. xjb2001(便衣超人)、 postfxj(探索者):保存到文件再来弄,还不如直接从数据库取。我觉得。^-^ truexf(小方):要我自己写个控件?暂时还没这个打算。^-^没有回复的不要有意见啊。可能是我没看到。比较多。我该昨天下班之前来看一下的。^-^。谢谢大家了。这个贴再挂一会。基本上好像是不能实现我的要求了。但看看能不能有其他的,好一点的方法。^-^。
谢谢大家。我中午再来。^-^
上见过一个第三方的内存表 还支持简单的SQL
不过重的来说偶也觉得这样做有点吃力不讨好
楼主到低是要实现什么功能呢
是想把数据只在内存里操作不提交到数据库里?那样的话设批处理就行拉
解决问题的方法有很多 不用钻牛角尖吧