r/SQL • • Aug 02 '26

SQL Server Importing from Excel using 'from openrowset()' returns OLE DB error

Hey everyone,

I'm trying to make this user stored procedure work on my colleagues PC, I can run it just fine.

Basically it's a USP created for importing data from an Excel file stored on shared network (local server).

It's goes like this:

select *

from openrowset ( 'Microsoft.ACE.OLEDB.12.0', 'Excel 12.0 Xml;Database="path\file.xlsx, sheet$ )

Me and one other colleague can run it just fine, but on one colleagues PC, it gives this error:

OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message"Failure creating file"

Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)"

Any help with resolving this would be much appreciated.

Thanks!

2 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/IanYates82 Aug 02 '26

Literally use file explorer to copy the file to be on the same computer that's running sql server. It'll take away one whole potential source of issues - if your colleague can read a file that's local to their sql server instance, but cannot read using a UNC path, then, via differential diagnosis, you know you have some file access issues of some sort. If it fails the same way, then it's more to do with the driver or sql server config (but still get it working against that local file first)

1

u/dzemperzapedra Aug 02 '26

We tried copying the file on colleague's machine but still get the same error, so the result is the same whether the file is on their machine or on server.

It's a work environment so SQL server is running independently from our workstation machines, so that can't be tested.