After applying SQL Server 7.0 Service Pack 2, a user may receive the following error message when using the OPENROWSET Transact-SQL function:
7415 - Ad hoc access to OLE DB provider '%ls' has been denied. You must access this provider through a linked server.
This can occur even when
Ad Hoc Query Access has been explicitly allowed for the OLE DB provider being used.
The OPENROWSET function will succeed most of the time, but the error may occur a small amount of the time.
The registry value
DisallowAdhocAccess may also have to be added, depending on how the clients are connecting to SQL Server; see the table in the "More Information" section of this article for additional information.