无法对封闭的数据集执行此操作 [英] Cannot perform this operation on a closed dataset
本文介绍了无法对封闭的数据集执行此操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
无法在关闭的数据集上执行此操作...
ADOQuery1。活动:=虚假;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from Table1 where Column1 =< value>');
ADOQuery1.Open;
任何猜测为什么我收到此错误?
解决方案
你的代码看起来不错。
检查是否有任何事件处理程序(OnBeforeOpen)或附加到查询的主/详细数据源。在这种情况下,仍然关闭的不同数据集可能会导致错误。
I am just trying to execute the "select" sql statement using TADOQuery component, but when TADOQuery's "Open" statement is executing I am getting following error:
Cannot perform this operation on a closed dataset...
ADOQuery1.Active := False;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('Select * from Table1 where Column1 = <value>');
ADOQuery1.Open;
Any guess why I am getting this error ?
解决方案
Your code looks fine.
Check if there are any event handlers (OnBeforeOpen) or master/detail datasources attached to the query. In this case a different dataset, which is still closed, could cause the error.
这篇关于无法对封闭的数据集执行此操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文