Microsoft.ACE.OLEDB.16.0 - OPENRowSet not working from remote machine or agent

%3CLINGO-SUB%20id%3D%22lingo-sub-2579666%22%20slang%3D%22en-US%22%3EMicrosoft.ACE.OLEDB.16.0%20-%20OPENRowSet%20not%20working%20from%20remote%20machine%20or%20agent%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2579666%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20guys%3C%2FP%3E%3CP%3ENew%20to%20forum%20here%20so%20treat%20me%20gently.%3C%2FP%3E%3CP%3EWe%20have%20been%20using%20OPENROWSET%20with%26nbsp%3BMicrosoft.ACE.OLEDB.16.0%20to%20import%20excel%20data%20to%20SQL%20server%20for%20some%20time%20and%20when%20logged%20into%20the%20physical%20server%20on%20which%20the%20instance%20is%20installed%20everything%20works%20fine.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EHowever%20we%20are%20unable%20to%20run%20the%20OPENROWSET%20query%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3Ea.%20Through%20SQL%20Server%20agent%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3Eb.%20Via%20SSMS%20from%20a%20laptop%2FPC%20that%20is%20connecting%20to%20the%20instance%20vis%20SSMS%20with%20Windows%20login.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20means%20that%20overnight%20agent%20jobs%20can't%20be%20set%20up%20to%20manage%20excel%20files%20which%20have%20changed%20during%20the%20day.%20Also%20have%20to%20access%20server%20via%20remote%20desk%20top%20to%20the%20physical%20server%20where%20the%20instance%20is.%3CBR%20%2F%3ENone%20of%20this%20is%20ideal!%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EError%20message%20is%3A%3C%2FP%3E%3CP%3EMsg%207399%2C%20Level%2016%2C%20State%201%2C%20Line%205%3C%2FP%3E%3CP%3EThe%20OLE%20DB%20provider%20%22Microsoft.ACE.OLEDB.16.0%22%20for%20linked%20server%20%22(null)%22%20reported%20an%20error.%20The%20provider%20did%20not%20give%20any%20information%20about%20the%20error.%3CBR%20%2F%3EMsg%207303%2C%20Level%2016%2C%20State%201%2C%20Line%205%3CBR%20%2F%3ECannot%20initialize%20the%20data%20source%20object%20of%20OLE%20DB%20provider%20%22Microsoft.ACE.OLEDB.16.0%22%20for%20linked%20server%20%22(null)%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAll%20the%20googling%20on%20the%20issue%20talks%20about%20getting%20it%20connected%20and%20working.%20We%20have%20done%20that%20on%20the%20physical%20server%2C%20but%20I%20can't%20find%20any%20help%20on%20running%20a%20query%20remotely%20or%20through%20the%20agent.%3CBR%20%2F%3EI%20guess%20the%20issue%20centres%20around%20permissions.%20When%20working%20on%20the%20server%20we%20are%20using%20%7BSERVERNAME%5D%5CAdministrator%20whereas%20remotely%20we%20are%20logging%20in%20using%20Windows%20user%20name.%20No%20Idea%20how%20the%20agent%20logs%20in!%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EI%20have%20tried%20EXECUTE%20AS%20but%20doesn't%20seem%20to%20work%20either%20even%20when%20executing%20as%20Administrator%20on%20physical%20server.%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20anyone%20can%20offer%20some%20help%20here%2C%20I'd%20be%20really%20grateful%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3EPete%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi guys

New to forum here so treat me gently.

We have been using OPENROWSET with Microsoft.ACE.OLEDB.16.0 to import excel data to SQL server for some time and when logged into the physical server on which the instance is installed everything works fine.

 

However we are unable to run the OPENROWSET query:

a. Through SQL Server agent

b. Via SSMS from a laptop/PC that is connecting to the instance vis SSMS with Windows login.

 

This means that overnight agent jobs can't be set up to manage excel files which have changed during the day. Also have to access server via remote desk top to the physical server where the instance is.
None of this is ideal!


Error message is:

Msg 7399, Level 16, State 1, Line 5

The OLE DB provider "Microsoft.ACE.OLEDB.16.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 5
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.16.0" for linked server "(null)".

 

All the googling on the issue talks about getting it connected and working. We have done that on the physical server, but I can't find any help on running a query remotely or through the agent.
I guess the issue centres around permissions. When working on the server we are using {SERVERNAME]\Administrator whereas remotely we are logging in using Windows user name. No Idea how the agent logs in! 

I have tried EXECUTE AS but doesn't seem to work either even when executing as Administrator on physical server.

If anyone can offer some help here, I'd be really grateful

 

Thanks

Pete

 

1 Reply

We have done some work on this over the last few days and found a workaround that will work for us.

 

Firstly EXECUTE AS is not a thing since this doesn't work wit distributed/ad hoc queries.

 

The inspiration came from this post: Error: 17053 -UpdateUptimeRegKey: Operating system error 5(Access is denied.) encountered, messages ....

 

Having changed the registry entry on the server as described above everything started to take shape.

A stored procedure using ACE can now be run remotely and by SQL Agent. The only proviso is the excel files being accessed must be in a folder on the physical server where the SQL instance sits and permissions given to users to access that folder.

Hope this was helpful

Pete