Link to home
Start Free TrialLog in
Avatar of crundle32
crundle32

asked on

MS SQL OPENDATASOURCE

Using OPENDATASOURCE Microsoft.ACE.OLEDB.12.0  and works just fine if used in Management studio on the SQL server but if from web page or via another Management Studio get the below errors;
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "Unspecified error".
OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "Unspecified error".      

If I add "Integrated Security=SSPI;" then the last two errors go away but get #1 on all three (MGT Studio x 2 and Web page)
Avatar of Marten Rune
Marten Rune
Flag of Sweden image

Have you configured the server for adHoq Querys.
It says error linked server, but you are using openrowset, look at:
http://msdn.microsoft.com/en-us/library/ms187569.aspx

If you prefere to use linked server, look at my example in:
https://www.experts-exchange.com/questions/27955235/Linked-Severs-on-MS-SQL-2008R2.html

Regards Marten
Avatar of crundle32
crundle32

ASKER

Ad Hoc is done, if i run the SQL directly on the machine it works fine, run it awaywhere else I get the error.

It's reading an excell work sheet "\\Storage\ExcelFiles\Filename.xlsx, with permissions set "everyone" "Full Control"
Are the different servers the same
i e SQL Version, AND are the OS versions the same, i e 32 or 64 bit.

The share is it a Windows machine, or a nas/san thing

Regards Marten
How you configured the linked server?
The 32bit or 64bit question is also pertinent.
I have tried both via network path and local on SQL server, please remember it works when I log directly into the server mgt studio. I created a xp_cmdshell in SP and ran from the web page worked fine to get the Dir.

All systems are 64 bit
Check what account runs the sql server service, and the agent service.
If it's local system, try altering to network service. Or even better a domain account.

If it still wont work with a domain account, then run ssms as another user, use the sql service/agent service domain account. Now with this credential run the cmdshell against the network share, i'm betting you'll get some error thats understandable and will lead you to a solution.

Regards Marten
Oh yes, remember to alter the accounts in the sql server configuration manager.

Regards Marten
Pls explain more on how to set the account used. From web page I had to add domain\computername for access which I further confirmed by creating a script that logs user_name.
SQL Server Configuration Manager is used to change the account. This is because the ACL for the filesystem are altered.
The account needs to exist, should be a normal service account created in the AD.
This account should have read permission on the sharing and ACL on the Excel file.

What are your specific question:
How to create a serviceaccount in the AD?
How to change using SSCM?
Something else?

Im not talking about a webserver, I'm referencing the SQL instance host.

Regards Marten
I guess it would be "Change SSCM", I know how to create in AD, I understand creating users in the Security>Logins, but how to get the t-sql to run and a specific user as I believe the webpage is calling network service  which is where the permission is causing the error. Hence once I login directly as admin it works.
ASKER CERTIFIED SOLUTION
Avatar of Marten Rune
Marten Rune
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You might want to authenticate the SQL Server Agent account with the same account, just repeat the same process but with the SQL Server Agent (instance) as the chosen object, instead of the SQL Server service (instance) object.

All is written straight out of my head. But Im fairly sure the names/and paths are correct.

Regards Marten