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)
 Very-Basic Linked Server Problem

Author  Topic 

iDev
Starting Member

8 Posts

Posted - 2008-01-16 : 13:40:48
I'm having a problem selecting from an Excel linked server...

1. Create a new simple Excel file at C:\DeleteMe.xls and add a couple column headers and a row of data. e.g.

--------------
ColA | ColB |
--------------
123 | 456 |
-------------

2. Execute the following command in SQL Server 2005 Management Studio...

EXEC sp_addlinkedserver
@server = 'ExcelSource',
@srvproduct = 'Excel',
@provider = 'Microsoft.Jet.OLEDB.4.0',
@datasrc = 'Database=C:\DeleteMe.xls',
@provstr = 'Excel 5.0'

select * from ExcelSource...[Sheet1$]

If you're like me, you'll get the following error:

Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "ExcelSource" reported an error. The provider did not give any information about the error.
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 "ExcelSource".


Does anyone have a solution?

THANKS in advance.
   

- Advertisement -