Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8

Thread: Error

  1. #1
    Regular Coder
    Join Date
    Mar 2007
    Location
    UK
    Posts
    151
    Thanks
    9
    Thanked 2 Times in 2 Posts

    Exclamation Error

    Ive just started to learn asp and i get this message when i try to view a page i made:
    Code:
    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
    Code:
    Recordset1_cmd.ActiveConnection = MM_asp_STRING
    Heres all my code:
    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

  • #2
    SSJ
    SSJ is offline
    Regular Coder
    Join Date
    Mar 2007
    Posts
    230
    Thanks
    0
    Thanked 4 Times in 4 Posts
    post the code of connections/asp.asp file


    -SSJ

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,960
    Thanks
    0
    Thanked 236 Times in 233 Posts
    The Access db is open in Access while you are running the page. Close the db file and try running the page again.

  • #4
    Regular Coder
    Join Date
    Mar 2007
    Location
    UK
    Posts
    151
    Thanks
    9
    Thanked 2 Times in 2 Posts
    Here is asp.asp
    Code:
    <%
    ' 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

  • #5
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,062
    Thanks
    4
    Thanked 8 Times in 8 Posts
    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.

  • #6
    Regular Coder
    Join Date
    Mar 2007
    Location
    UK
    Posts
    151
    Thanks
    9
    Thanked 2 Times in 2 Posts
    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

  • #7
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #8
    SSJ
    SSJ is offline
    Regular Coder
    Join Date
    Mar 2007
    Posts
    230
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Very helpful URL


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •