I enabled Ad Hoc Remote queries in SQL Server 2005. I tried to read a table in SQL Server 2000 from 2005 using OPENROWSET.
SELECT a.*
FROM OPENROWSET('MSDASQL', 'DRIVER=(SQL SERVER);Server=databaseserver;UID=userid;PWD=password',
'SELECT * FROM table') AS a
I have the following error.
Msg 7415, Level 16, State 1, Line 1
Ad hoc access to OLE DB provider 'MSDASQL' has been denied. You must access this provider through a linked server.
I tried to change the provider to SQLNCLI or SQLOLEDB and it still did not work.