Cannot perform this operation on a closed dataset

前端 未结 2 605
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-22 09:42

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:



        
相关标签:
2条回答
  • 2021-01-22 09:55

    The issue is resolved, I am using SQL Server 2008 as database.

    Here "SetAppRole" was not applied on the database, after applying it, now there is no error.

    0 讨论(0)
  • 2021-01-22 10:11

    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.

    0 讨论(0)
提交回复
热议问题