If you use ODBC connection (DSN or DSN-less) to access the remote (UNC path) database, OLEDB will see the following error message:
Microsoft ole db Provider for ODBC Drivers error '000000'
[Microsoft] [ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown )'. it is already opened exclusively by another user, or you need permission to view its data.
You can avoid this error. ASP and ActiveX support two methods to open the DSN-less connection to the MDB file, or access the MDB file from other machines.
1. DAO database (only for small load)
Dim File, Conn, RS
Const ReadOnly = False
File = "\ server \ share \ file. mdb"
Set Conn = CreateObject ("DAO. DBEngine.35"). Workspaces (0). OpenDatabase (File, ReadOnly)
Set RS = Conn. OpenRecordset (SQL)
2. ADO + Jet ole db provider
Dim Conn, RS
Set Conn = CreateObject ("ADODB. Connection ")
Conn. Provider = "Microsoft. Jet. OLEDB.4.0"
Conn. Open "\ server \ share \ file. mdb"
Set RS = Conn. Execute (SQL)
Make sure that ASP users have NT database and shared access permissions.
If you have the permission, you can also access open data connections on other machines:
'Http: // www. pstruh. cz
Set UM = CreateObject ("UserManager. Server ")
UM. LogonUser "Login with the rights", "Password", "Domain"
...
Open database
...
UM. RevertToSelf