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)
 Excel to SQL

Author  Topic 

nod
Starting Member

19 Posts

Posted - 2005-05-11 : 12:07:40
Anyone know how I can link in an Excel spreadsheet from SQL Server? I tried doing the LinkServer but it didn't me very much, maybe I did something wrong any ideas?

X002548
Not Just a Number

15586 Posts

Posted - 2005-05-11 : 12:22:55
BOL

quote:

F. Use the Microsoft OLE DB Provider for Jet on an Excel Spreadsheet
To create a linked server definition using the Microsoft OLE DB Provider for Jet to access an Excel spreadsheet, first create a named range in Excel specifying the columns and rows of the Excel worksheet to select. The name of the range can then be referenced as a table name in a distributed query.

EXEC sp_addlinkedserver 'ExcelSource',
'Jet 4.0',
'Microsoft.Jet.OLEDB.4.0',
'c:\MyData\DistExcl.xls',
NULL,
'Excel 5.0'
GO

In order to access data from an Excel spreadsheet, associate a range of cells with a name. A given named range can be accessed by using the name of the range as the table name. The following query can be used to access a named range called SalesData using the linked server set up as above.

SELECT *
FROM EXCEL






Brett

8-)
Go to Top of Page

nod
Starting Member

19 Posts

Posted - 2005-05-11 : 12:57:34
I've neve rgotten it to work well..try it and let me know if it actually works for you. I'm getting "Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. The provider did not give any information about the error.
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005: The provider did not give any information about the error.].
"
Go to Top of Page

nod
Starting Member

19 Posts

Posted - 2005-05-11 : 14:11:32
I've neve rgotten it to work well..try it and let me know if it actually works for you. I'm getting "Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. The provider did not give any information about the error.
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005: The provider did not give any information about the error.].
"
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2005-05-11 : 14:53:23
I don't know...why don't you just schedule a DTS job to run and refesh a table that matches EXCEL...it would be more effecient anyway



Brett

8-)
Go to Top of Page
   

- Advertisement -