Re: non-sa users get access denied in OLE DB query
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Sat, 10 Feb 2007 18:02:05 +0000 (UTC)
Stu (Stu@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
But turned on, uness you have sysadmin privs, you get this message:
Msg 7415, Level 16, State 1, Line 1
Ad hoc access to OLE DB provider 'IBMDADB2' has been denied. You must
access this provider through a linked server.
So, with ad hoc turned on, how do you permission non-sa logins to access
the OLE DB provider?
Books Online gives us this little tidbit:
OPENROWSET can be used to access remote data from OLE DB data sources
only when the DisallowAdhocAccess registry option is explicitly set to
0 for the specified provider, and the Ad Hoc Distributed Queries
advanced configuration option is enabled. When these options are not
set, the default behavior does not allow for ad hoc access.
i search the registry for DisallowAdhocAccess and I found that under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\Providers
there is a whole list of providers. Of these SQLNLCI has DisallowAdhocAccess
set to 0, but the others not. I did a test with a plain-test user, and
it was able to use OPENROWSET with SQLNCLI, but not with MSDASQL that
did not have DisallowAdhocAccess listed.
So that seems to be the key.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Follow-Ups:
- Re: non-sa users get access denied in OLE DB query
- From: Dejan Sarka
- Re: non-sa users get access denied in OLE DB query
- References:
- Re: non-sa users get access denied in OLE DB query
- From: Dejan Sarka
- Re: non-sa users get access denied in OLE DB query
- Prev by Date: Re: how to get all the user permission in 1 query?
- Next by Date: Re: SQL SOX audit and logging
- Previous by thread: Re: non-sa users get access denied in OLE DB query
- Next by thread: Re: non-sa users get access denied in OLE DB query
- Index(es):
Relevant Pages
|