I tried to run this command, and am getting the error message. How can I solve it
INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'SELECT * FROM [Sheet1$]')
SELECT * FROM dbo.contract Where PROJECTID=160
Msg 15281, Level 16, State 1, Line 1
SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server.
A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure.