View Full Version : Error

03-06-2007, 11:09 PM
Ive just started to learn asp and i get this message when i try to view a page i made:

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.

/report.asp, line 9

On line 9 i have
Recordset1_cmd.ActiveConnection = MM_asp_STRING

Heres all my code:

<!--#include file="Connections/asp.asp" -->
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows

Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_asp_STRING
Recordset1_cmd.CommandText = "SELECT * FROM newsletter_info"
Recordset1_cmd.Prepared = true

Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>

<p>Report on Users </p>
<table width="989">
<td width="135">UserID</td>
<td width="145">Username</td>
<td width="148">Password</td>
<td width="120">Email Address </td>
<td width="155">IP Address </td>
<td width="141">Browser</td>
<td width="113">Last Logged in </td>

While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
<table width="993">
<td width="134"><%=(Recordset1.Fields.Item("UserID").Value)%></td>
<td width="146"><%=(Recordset1.Fields.Item("username").Value)%></td>
<td width="148"><%=(Recordset1.Fields.Item("password").Value)%></td>
<td width="120"><%=(Recordset1.Fields.Item("email").Value)%></td>
<td width="155"><%=(Recordset1.Fields.Item("ip_address").Value)%></td>
<td width="139"><%=(Recordset1.Fields.Item("broswer").Value)%></td>
<td width="119">&nbsp;</td>
Set Recordset1 = Nothing

Ive looked all over the internet and i cant find a solution HELP Ahhhhh :(

03-07-2007, 05:21 AM
post the code of connections/asp.asp file


03-07-2007, 05:27 PM
The Access db is open in Access while you are running the page. Close the db file and try running the page again.

03-07-2007, 05:41 PM
Here is asp.asp

' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
MM_asp_STRING = "dsn=asp;"
i tried closing the database didnt work

03-07-2007, 06:21 PM
When you set your DSN up did you test the connection?

Also have you tried using a DSNLess connection instead of a DSN. At my work we have found that some of the smaller work that was still being done in Access would throw that error (among others) especially on Win2003 server. Getting rid of the DSN eliminated a lot of it getting rid of Access eliminated the rest ;)

BTW when you have Access open you will see another file with the name of the database.ldb. This is Access locking the file and preventing other changes to the database while the user has it open.

03-07-2007, 07:05 PM
How do i connect to the database if theres no dsn? and i tested the connection when i set it up and it said sussess

03-08-2007, 10:39 AM

03-08-2007, 12:03 PM
Very helpful URL

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum