...

View Full Version : Error



tyanque
03-07-2007, 12:09 AM
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:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<p>Report on Users </p>
<table width="989">
<tr>
<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>
</tr>
</table>

<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<table width="993">
<tr>
<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>
</tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
<p>&nbsp;</p>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>


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

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


-SSJ

glenngv
03-07-2007, 06: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.

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

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

miranda
03-07-2007, 07: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.

tyanque
03-07-2007, 08: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

degsy
03-08-2007, 11:39 AM
http://www.connectionstrings.com/?carrier=access

SSJ
03-08-2007, 01:03 PM
http://www.connectionstrings.com/?carrier=access
Very helpful URL



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum