« Previous Next »

Thread: database connectivity to ms access 2000 using asp on iis7

Last post 12-13-2007 2:43 AM by gulati. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 12-12-2007, 5:30 AM

    • gulati
    • Not Ranked
    • Joined on 11-29-2007, 5:40 AM
    • Posts 2

    database connectivity to ms access 2000 using asp on iis7

    I am trying to connect asp file on local host on vista ultimate using iis7.

    I am getting error |9|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.

    I have created DSN connection using odbcad32 in syswow64 folder . As a user of admistrator group I have permission to access database. I am using the following code in asp file.

    <html>
    <head><title>Responding to a form</title></head>
    <body>
    <%
     
    set cn=Server.CreateObject("ADODB.Connection")
    set rs=Server.CreateObject("ADODB.Recordset")

    cn.Open "DSN=mydsn"
    %>
    welcome  with
     to asp tutorial
    </body>
    </html>

  • 12-12-2007, 7:57 AM In reply to

    Re: database connectivity to ms access 2000 using asp on iis7

    FAQ:  http://www.aspfaq.com/search.asp?q=80004005

    You may have permission to open the database,but does the account trying to access the database have permission?  Most likely it's not the logged in user but rather the anonymous user.

    Jeff

    Look for Wrox's new book Professional IIS 7 in your local bookstore, or order now at Amazon.com
  • 12-13-2007, 2:43 AM In reply to

    • gulati
    • Not Ranked
    • Joined on 11-29-2007, 5:40 AM
    • Posts 2

    Re: database connectivity to ms access 2000 using asp on iis7

     Thnaks Jeff for helping me in finding help for error 80004005. I have given permission for iuser(machine) as well as anonymous user to database as well as folder for the database and temp folder of the user. I have  updated applicationhost.config by disabling loadUserProfile property .  I have used the following commands for giving permission to temp folder of network services.

    icacls %windir%\serviceprofiles\networkservice\AppData\Local\Temp /grant Users:(CI)(S,WD,AD,X)
    icacls %windir%\serviceprofiles\networkservice\AppData\Local\Temp /grant "CREATOR OWNER":(OI)(CI)(IO)(F).
    on checking the users and CREATOR OWNER gets the special permission on temp folder.

    The error i am getting is 

    Microsoft JET Database Engine error '80004005'

    Unspecified error

     with the following code

    <%
    cst = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
            "Data Source=" & Server.MapPath("hello.mdb")

    //response.write(cst)
        set conn = CreateObject("ADODB.Connection")
     
    conn.open cst
     
    //set cn=Server.CreateObject("ADODB.Connection")
    //set rs=Server.CreateObject("ADODB.Recordset")

    //cn.Open "DSN=mydsn"
    %>

Page 1 of 1 (3 items)
Microsoft Communities