[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How can I link to Excel spreadsheet with space in UNC

Posted on 2009-02-09
4
Medium Priority
?
538 Views
Last Modified: 2012-06-21
How can I link to an Excel spreadsheet where the UNC and file name have spaces in them?
For instance what I am using is this:
EXEC sp_addlinkedserver 'ExcelSource',
   'Jet 4.0',
   'Microsoft.Jet.OLEDB.4.0',
'\\vfs\ab common\123\Other\Server Survey\updated_INFO and Cable Survey Schedule_SJS.xls',
      NULL,
   'Excel 5.0'
GO

It "appears" to link okay but when I query against it I get messages like:
Query - SELECT * FROM OPENQUERY(excelsource, 'SELECT * FROM [Server List]')
------
OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "excelsource" returned message "Cannot start your application. The workgroup information file is missing or opened exclusively by another user.".
Msg 7399, Level 16, State 1, Procedure sp_tables_ex, Line 41
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "excelsource" reported an error. Authentication failed.
Msg 7303, Level 16, State 1, Procedure sp_tables_ex, Line 41
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "excelsource".
0
Comment
Question by:edrz01
  • 2
  • 2
4 Comments
 
LVL 25

Accepted Solution

by:
reb73 earned 2000 total points
ID: 23589887
I'm not sure if the issue is the embedded spaces in the XLS filename..

Did you try copying the XLS file to a local path, removing embedded spaces and establishing the spaces as the root cause?
0
 

Author Comment

by:edrz01
ID: 23590029
Thanks reb73. I just tried that and you are correct - same thing.

Still researching as to why I am getting the errors. I "assumed" it was due to the spaces but no I see it is something else lurking.....
0
 
LVL 25

Expert Comment

by:reb73
ID: 23590208
What exactly is '[Server List]' within the Excel sheet? Is it a named range or a sheetname??
0
 

Author Comment

by:edrz01
ID: 23590301
Sheetname.

I have also tried another sheet - same thing.

BTW - this is Office 12.

I used this to add it this time:
EXEC sp_addlinkedserver EXCEL,
'Jet 4.0',
'Microsoft.Jet.OLEDB.4.0',
'e:\updated_INFOandCableSurveySchedule_SJS.xls',
NULL,
'Excel 5.0;'

And now when I run EXECUTE SP_TABLES_EX 'excel' I get
TABLE_CAT      TABLE_SCHEM   TABLE_NAME     TABLE_TYPE     REMARKS
(0 row(s) affected)

When I try to query a sheet using this:
select * from excel...[plan$]

I get the error:
Msg 7314, Level 16, State 1, Line 1
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "excel" does not contain the table "plan$". The table either does not exist or the current user does not have permissions on that table.

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question