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:
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.
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.