The problem is fixed. The Database should point only to the folder and not include the file:
'Text;Database=\\FOO\public; '
Question
I've created a folder called Public off the root of my C:\drive and have shared it with "Everyone". I've also given NETWORK SERVICE read rights. But when I issue the following query in SQL Server 2008-R2, the error is that "\\FOO\public\my.csv" is not a valid path:
SELECT *
FROM OPENROWSET (
'Microsoft.ACE.OLEDB.12.0',
'Text;Database=\\FOO\public\my.csv; ',
'SELECT * from my.csv'
)
The 64-bit driver of ACE is installed. I'm on Windows 7 x64. It's a 64-bit version of SQL Server. My PC's machine name is "FOO". It doesn't work with a simple c:\public
path either.
OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "'\FOO\public\my.csv' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.".
I've configured the server so:
exec sp_configure 'show advanced options', 1
RECONFIGURE;
exec sp_configure 'Ad Hoc Distributed Queries', 1
RECONFIGURE;
What else to check? Thanks
Solution
The problem is fixed. The Database should point only to the folder and not include the file:
'Text;Database=\\FOO\public; '