Connect to an Access database on another server

From: Tim Platt (anonymous_at_discussions.microsoft.com)
Date: 02/28/04


Date: Sat, 28 Feb 2004 12:26:06 -0800

Hi,

I would be grateful if someone out there with significantly more experience and knowledge could help me.

I have been quite happily building/small single server intranet site using ASP and ADO to collect and manage data in some MS Access databases, quite successfully.

We have now added a 2nd NT server to the network (which is also used as a web server). I want to collect data from an Access database on the 2nd server. I have tried all sorts of different addresses, both absolute and relative (example below), without success:

REM Open a connection using the Microsoft ODBC provider,
REM and a record set object.

        Set MyConnection = Server.CreateObject("ADODB.Connection")

REM Define the query string used to produce the recordset

        target = "SELECT * from targets"

        MyConnection.Open "driver={Microsoft Access Driver(.mdb)};dbq=R:\InetPub\wwwroot\databases\marketing\targets.mdb;uid=;pwd=;"

        Set MyRecordSet = Server.CreateObject("ADODB.RecordSet")

        myrecordset.open target, MyConnection

R:\ being the network drive I have used to connect the 2nd server

I get the following message:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[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.

Is this an NT permissions thing or is there somethin else I should be doing?

If you can point me in the right direction, I would really appreciate it.