Unix Technical Forum

Error creating linked server to Excel

This is a discussion on Error creating linked server to Excel within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi, Please help, I'm getting desperate. Any ideas warmly welcomed! I'm trying to read from a basic excel file ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 04:16 AM
Andy
 
Posts: n/a
Default Error creating linked server to Excel

Hi,
Please help, I'm getting desperate. Any ideas warmly welcomed!
I'm trying to read from a basic excel file (1000 or so rows from
column A) but am having problems. The code I am using is:

Declare @Return Int
SET NOCOUNT ON

Exec @Return= [master]..[sp_addlinkedServer] 'READ_XLS', 'EXCEL',
'Microsoft.Jet.OleDB.4.0' , 'e:\jsbackup\RACodes.xls',
NULL, 'EXCEL 8.0'
print 'set up Return : ' + convert(varchar(10),@Return)
--NB E: is the drive as seen oon the server

EXEC sp_addlinkedsrvlogin
@rmtsrvname = 'READ_XLS',
@useself = 'true'
print 'login Return : ' + convert(varchar(10),@Return)


When I try to read from the (one) excel sheet in the file, via
Select * from [READ_XLS]...RACodes$
or to list what tables/sheets are available, via
exec sp_tables_ex 'READ_XLS'

I get the following error:

OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
Authentication failed.
[OLE/DB provider returned message: Cannot start your application. The
workgroup information file is missing or opened exclusively by another
user.]
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'
IDBInitialize::Initialize returned 0x80040e4d: Authentication
failed.].

What am I missing?

*Many* thanks in advance.
Andy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 04:18 AM
Gerrit-Jan Linker
 
Posts: n/a
Default Re: Error creating linked server to Excel

A few things to check:

Do you have the .xls file already open?
Is e:\jsbackup\RACodes.xls a server path?
I recall that you have to set named ranges for it to appear as tables
in Excel.

I don't know whether it helps but I have written an addin for Excel
that can push the data out from Excel (you are trying to pull it in
from the database). If you can reconsider your design and push it from
Excel you can perhaps use it.

SQL*XL is an addin for Excel that let you manage your database from
Excel. It is an end-user tool but it also lets you record all actions
as a macro (VBA) and therefore you can code/script applications with
it.

Have a look at SQL*XL at www.oraxcel.com

Best regards, Gerrit-Jan Linker
Linker IT Consulting Limited
www.oraxcel.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:03 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com