October 14, 2009 at 10:11 am
Hello I am running the following command:
select * from OpenRowset(
'Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\test.xls',
'select * from [sheet1$]')
This works fine...
But when I change the path of the file to a file on the network (which I have comfirmed is accessible using windows explorer from the server) It comes back with the following error:
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error.
The code I am trying to execute is:
select * from OpenRowset(
'Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=\\anothercomputer\c$\test.xls',
'select * from [sheet1$]')
Any help with this would be great!
Thanks in advance
Bicky
October 14, 2009 at 11:37 am
Hi,
I guess this is due to the fact, that SQL Server does not access the file as you, but rather as the account it is running under. If it is running as Local System, it will not be able by default to reach to network resources. Try (if you can) to run the sql server service under your account.
Here's excerpt from BOL:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/18a64236-0285-46ea-8929-6ee9bcc020b9.htm
Regards
Piotr
...and your only reply is slàinte mhath
October 14, 2009 at 11:45 am
Permissions for the SQL account is usually the problem with these.
I've also had problems when someone else (or me) had the file open already.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
October 15, 2009 at 3:11 am
Thanks for the replies!
How do I check what the server is running as (whether its local host or not)
Thanks
October 15, 2009 at 9:06 am
On the server, go into services, find SQL Server Agent and double click it. Under the "Logon" tab it'll show the account running the service. That's the account that will need appropriate rights.
-- You can't be late until you show up.
October 15, 2009 at 10:24 am
I have checked what ther server is running as and its using the logon details from the SQL Administrator so surely they should have full rights?
Is there a way to check this?
Thanks
October 15, 2009 at 1:36 pm
Sql administrator as in "sa"? Or a domain admin account? sa will never hae rights to a data share. A domain account will need explicit rights to the share.
-- You can't be late until you show up.
October 15, 2009 at 1:56 pm
Both Domain and SQL Admin...
October 15, 2009 at 2:06 pm
See the last three replies not made by you. Each essentially states the same thing, the SQL Admin domain account needs permissions to your file share. If you do not know how to check it, get your network admin to help (I'm a little iffy on this task).
-- You can't be late until you show up.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply