We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

How can I link to Excel spreadsheet with space in UNC

edrz01
edrz01 asked
on
Medium Priority
574 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".
Comment
Watch Question

Commented:
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?

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
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.....

Commented:
What exactly is '[Server List]' within the Excel sheet? Is it a named range or a sheetname??

Author

Commented:
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.

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.