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 2005 Forums
 Transact-SQL (2005)
 Problem to Use LinkedServer for XLS File.

Author  Topic 

hdv212
Posting Yak Master

140 Posts

Posted - 2007-11-16 : 06:28:17
hi
i want to use LinkedServer to get query from excel file, i create liked server by this code :
exec sp_addlinkedserver 'test',
'Jet 4.0',
'Microsoft.Jet.OLEDB.4.0',
'd:\sss.xls',
NULL,
'Excel 5.0'
GO


and when i run this query :
select * from test...A


the following message has shown me :
OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "test" returned message "Cannot start your application. The workgroup information file is missing or opened exclusively by another user.".
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "test" reported an error. Authentication failed.
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "test".

where does my problem ?
Note : my excel file contains Northwind.Customers Table that i exported it via Export Data.

kishore_pen
Starting Member

49 Posts

Posted - 2007-11-16 : 06:37:10
in the select query "A" may be a specified named region, see the link: http://msdn2.microsoft.com/en-us/library/ms190479.aspx
Go to Top of Page

hdv212
Posting Yak Master

140 Posts

Posted - 2007-11-16 : 17:37:31
thanks for reply
i red that link and i doesn't found any useful subject that help me to solve my problem.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-11-17 : 01:07:20
Is excel file on sql server's local disk? Tried query it with openquery?
Go to Top of Page

hdv212
Posting Yak Master

140 Posts

Posted - 2007-11-17 : 03:22:57
thanks
can you give me more details about OpenQuery ?
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-11-17 : 21:24:12
Read books online.
Go to Top of Page
   

- Advertisement -