Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

ODBC error

I am trying to access a MS Access database which is on a remote server and with my DSN less connection I get the following error , can you please tell me what could be the reason behind.

My code is
%@LANGUAGE="VBSCRIPT"%>
<!--#INCLUDE virtual="/common/pricelist.asp"-->
<%
Dim ConnectionString
dim oConn

ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};" &_
"DBQ=\\Server167\BusOps\Maint_ Ren_ Web_ Page_ Upload_DB.mdb;DefaultDir=;UID=;PWD=;"

Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "Select * from [Maintenance Report] where country = 'AD'", ConnectionString

%>

and the error that I get is

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.

/Renewals/testfeb.asp, line 13
[1098 byte] By [madhuri.t] at [2007-11-11 7:54:05]
# 1 Re: ODBC error
One common issue in dealing with Access is that if a user opens the database via the Access GUI, it is locked and you cannot open a connection to it via ASP.

If you have it open for development, you need to close Access before testing your ASP page. If other users have access to it, you should place it in a restrcited directory that only your ASP has rights too.

If this is not your issue, please provide more info about your application environment and how Access is being used or is setup.

Good luck,
msanchez at 2007-11-11 17:26:19 >