Reputation: 798
I have an sql query that retrieves data from a network .csv file using OpenRowSet:
select * from openrowset ('Microsoft.ACE.OLEDB.12.0', 'Text;Database=\\1.1.1.1\C$\temp', 'Select * from test.csv')
1.1.1.1 is my web server. 2.2.2.2 is my sql server.
This works fine in SSMS. It used to work fine on the web server in classic ASP until 3 days ago but now it is returning an error:
query="select * from openrowset ('Microsoft.ACE.OLEDB.12.0', 'Text;Database=\\1.1.1.1\C$\temp;', 'Select * from test.csv')"
set rs=myCn.execute(query)
ERROR: "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "'\\1.1.1.1\C$\temp' 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.".
This indicates a permissions error. The account being used on the web server to access the SQL server is an SQL server authentication account, not a windows authentication account
The SQL server service is running under NT Service\MSSQLSERVER. The SQL server agent is running under NT Service\SQLSERVERAGENT.
Nothing has changed on either the web server or the SQL server as far as I can determine. One afternoon it was working. The next morning it was not. We simply lost access to network paths when executing this command from the web server. All other commands work fine.
The login -- kp1 -- is mapped to a credential with full access to the network and pretty much everything else at this point. It's an admin account. The user -- kp1 -- is mapped to the login kp1.
DisallowAdhocAccess is set to 0.
I've gone through all the StackOverflow topics I can find on this and nothing is working. What should I be looking for?
Thank you.
---UPDATE 2023-05-04 ---
I decided to just change the account under which the SQL service runs to a common windows account which exists on all our servers. All is well.
Upvotes: 0
Views: 109