I have a small PHP 7.4 program running off IIS 10 on Win Server 2019. Fresh Server 2019 install.
The program makes an odbc connect to a local .accdb file no problem.
It fails to connect to any network copy of that file:
Mapped a drive letter -or-
unc \\192.168....\folder\file.accdb -or-
\\Server_name\folder\file.accdb
Running the same code from VS 2019 on a non-server PC (uses IIS Express) works fine to all of the above test files. The reported error is:
SQLSTATE[HY000] SQLDriverConnect: -1032 [Microsoft][ODBC Microsoft Access Driver] The Microsoft Access database engine cannot open or write to the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view and write its data.
I have triple checked folder and file permissions; the file is not opened; AND no problem from the VS 2019 with IIS Express on another PC to the same file.
I think it is something about the IIS install but I have no more ideas on where to look!
ASKER
On the server, I have a program that uses oledb and it can read all the same test files on all the different paths shown above. Since oledb can read the files from the server, and since a different PC can read the files using odbc, I think the problem is somehow related to IIS and the network. It does not seem to be the file shares. Also, recall that IIS can work fine using odbc on a local copy of the file!