But make sure that wherever you move the query component that the app pool is running under a network domain account and not networks services.

Also try giving the app pool local admin to rule out the various permissions issues. Generally this issue crops up on a migrated farm, so you might want to rerun the psconfig to repair permissions as well.