Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Reading remote file using Openrowset

Author  Topic 

meenakshisingh0111
Starting Member

3 Posts

Posted - 2007-08-08 : 00:56:39
Hi,

I am accessing an excel file from a remote system through distributed query. When I run
exec master..xp_fileexist '\\machinename\foldername\filename.xls'

the SQL server returns 1 since it's able to locate the file on remote machine.
However when I execute

Select * FROM OPENROWSET( 'Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=\\at-cnstsql05\Compliance_ftp\l.xls','SELECT * FROM [Sheet1$]')

the server throwns an error

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
[OLE/DB provider returned message: Unspecified error]
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005: ].

Pls adv if there are additional settings or permission required to this file.

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-08-08 : 14:37:40
Sql service startup account needs permission on the file.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-08-09 : 03:17:26
Also the file should be closed when you query on it
For more informations refer
http://sqlteam.com/forums/topic.asp?TOPIC_ID=49926

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -