Query an excel with SQL Server connection

Hi,

I would like to use an excel as a datasource.

With an SQL Server connection I could use the OPENROWSET function in my query, so the following works fine in Grafa and SQL Server Management Studio as well:

SELECT * FROM OPENROWSET(

‘Microsoft.ACE.OLEDB.12.0’,

‘Excel 12.0;Database=c:\TEST\Test.xlsx’,

‘SELECT * FROM [Adatok$]’)

If I replace the path of the database to a network path, the query produces error in Grafana, but in the SQL Server Management Studio executes it correctly.

So the following query only works in SSMS:

SELECT * FROM OPENROWSET(

‘Microsoft.ACE.OLEDB.12.0’,

‘Excel 12.0;Database=\PathInOurNetwork\TEST\Test.xlsx’,

‘SELECT * FROM [Adatok$]’)

In Grafana, the error message is the following: „mssql: Cannot initialize the data source object of OLE DB provider “Microsoft.ACE.OLEDB.12.0” for linked server “(null)”.”

The user what I use in the MSSQL connection has access to the file on the network.

Could you help me what is the difference between the two system in this situation?

Thank you!