Connect to a Remote Database Using ASP

Connect to a Remote Database Using ASP


How do I connect to an Access database that resides on a network server other than the Web server? My goal is to query the Access database and display the results in an ASP page. However, after I set up a DSN on the Web server, I get the error message:

Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Microsoft Access 97 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.

If I copy the database to the Web server and access it locally, it works. If I copy my ASP file to the same directory on the remote server where the Access database resides, set up a virtual directory to that location across the network, and then access the ASP page using the virtual directory, it also works. However, I want to access the database across our network using the ASP page on the Web server.


There could be two reasons why you cannot see the database from your Web server. First, you are using a drive letter for the location of the database and this is not resolving correctly. Instead, try using a UNC name (\servernamedrivedirectory) to locate your database. Second, when you access the database from your Web server (via ASP), the account that the Web server uses is a special user account called IUSR_yourservername. This user has permissions to mess around with the same machine (Web server), but he does not have permissions across the network on the database machine. See if you or your network administrator can provide access permissions to this user across the network. Then try again.

See also  5 Ways to Improve Customer Experience

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist