locked
Failed to map the path '/DocView/fpdb/documents.mdb'. RRS feed

  • Question

  • User1575881118 posted

     I have an application that is giving me this error message when trying to run a query on

    ExecuteNonQuery requires an open and available Connection. The connection's current state is closed

     

    error from VS is the following,

    <title>Failed to map the path '/DocView/fpdb/documents.mdb'.</title><style> body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } </style>

    Server Error in '/docmanage' Application.

    Failed to map the path '/DocView/fpdb/documents.mdb'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: Failed to map the path '/DocView/fpdb/documents.mdb'.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [InvalidOperationException: Failed to map the path '/DocView/fpdb/documents.mdb'.]
       System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +8853082
       System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath) +42
       System.Web.VirtualPath.MapPathInternal() +4
       System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping) +107
       System.Web.HttpRequest.MapPath(VirtualPath virtualPath) +37
       System.Web.HttpServerUtility.MapPath(String path) +99
       DocManage.uploadfile.getDept() +111
       DocManage.uploadfile.Page_Load(Object sender, EventArgs e) +33
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       System.Web.UI.Control.LoadRecursive() +50
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
    
     

     I have two more applications just like this without any issues, don't see any issues in the codes. Any ideas or help anyone?

    Friday, May 29, 2009 3:29 PM

Answers

  • User-821857111 posted

    I was referring to App_Data which is a special ASP.NET folder that does not allow browsing.  However, the permissions need to be applied to whichever folder you have chosen to put the mdb file.  App_Data is preferred: http://www.mikesdotnetting.com/Article.aspx?ArticleID=78.  As it says in the article, on Server 2003, the default user account under which ASP.NET runs is NETWORK SERVICE.

    I've just re-read the article, and I cannot see why you are confused.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 2, 2009 3:32 PM

All replies

  • User-1310737633 posted

    What code are you using to navigate to the file?

    Pls. post the code.

    Saturday, May 30, 2009 4:05 AM
  • User-1199946673 posted

    Well, the error says it all. "ExecuteNonQuery requires an open and available Connection. The connection's current state is closed", I've seen many more errors that are much harder ro figure out! It says what s required (an open and available connection) and what is wrong (the connection is not open but closed)

    just before you you call ExecuteNonQuery, you should open your connection, and afterwards close it as soon as possible again!

    Saturday, May 30, 2009 7:33 AM
  • User1575881118 posted

     <%@ Page CodeBehind="addCompany.aspx.vb" Language="vb" AutoEventWireup="false" Inherits="DocManage.addCompany" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <HTML>
        <HEAD>
            <title>Arklatex Underwriters, Inc.: Documents & News Manager </title>
            <!-- saved from url=(0014)about:internet -->
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
            <style type="text/css">TD IMG { DISPLAY: block }
        </style>
            <!--Fireworks 8 Dreamweaver 8 target.  Created Mon Mar 19 09:18:50 GMT-0400 (Eastern Daylight Time) 2007-->
        </HEAD>
        <body bgcolor="#000033">
            <form id="Form1" method="post" runat="server">
            <p>&nbsp;</p>
            <table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
                <!-- fwtable fwsrc="arktemplate.png" fwbase="arktemplate.gif" fwstyle="Dreamweaver" fwdocid = "1653865989" fwnested="0" -->
                <tr>
                    <td><img src="images/spacer.gif" width="13" height="1" border="0" alt=""></td>
                    <td><img src="images/spacer.gif" width="175" height="1" border="0" alt=""></td>
                    <td><img src="images/spacer.gif" width="29" height="1" border="0" alt=""></td>
                    <td><img src="images/spacer.gif" width="145" height="1" border="0" alt=""></td>
                    <td><img src="images/spacer.gif" width="25" height="1" border="0" alt=""></td>
                    <td><img src="images/spacer.gif" width="13" height="1" border="0" alt=""></td>
                    <td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
                </tr>
                <tr>
                    <td colspan="2" background="images/arktemplate_r1_c3.gif">
                        <img name="arktemplate_r1_c1" src="images/arktemplate_r1_c1.gif" width="250" height="52"
                            border="0" id="arktemplate_r1_c1" alt="" align="middle"></td>
                    <td background="images/arktemplate_r1_c3.gif"><img name="arktemplate_r1_c3" src="images/arktemplate_r1_c3.gif" width="29" height="52"
                            border="0" id="arktemplate_r1_c3" alt=""></td>
                    <td colspan="3" background="images/arktemplate_r1_c3.gif"><img name="arktemplate_r1_c4" src="images/arktemplate_r1_c4.gif" width="183" height="52"
                            border="0" id="arktemplate_r1_c4" alt="" align="right"></td>
                    <td><img src="images/spacer.gif" width="1" height="52" border="0" alt=""></td>
                </tr>
                <tr>
                    <td background="images/arktemplate_r2_c1.gif"><img name="arktemplate_r2_c1" src="images/arktemplate_r2_c1.gif" width="13" height="186"
                            border="0" id="arktemplate_r2_c1" alt=""></td>
                    <td colspan="4" valign="top" bgcolor="#000066" align="center">
                            <TABLE id="Table1" cellSpacing="0" cellPadding="0" border="0">
                                <TR>
                                    <TD align="left" colSpan="16"></TD>
                                </TR>
                                <TR>
                                    <TD colSpan="16" align="center"><asp:label id="Label1" runat="server" ForeColor="White" Font-Bold="True" Font-Size="Large">Add
                                        Market</asp:label></TD>
                                </TR>
                                <TR>
                                    <TD><asp:label id="Label4" runat="server" ForeColor="#000066">Label</asp:label></TD>
                                    <TD colSpan="5"></TD>
                                    <TD></TD>
                                    <TD colSpan="5"></TD>
                                    <TD></TD>
                                    <TD></TD>
                                    <TD></TD>
                                    <TD><asp:label id="Label5" runat="server" ForeColor="#000066">Label</asp:label></TD>
                                </TR>
                                <TR>
                                    <TD></TD>
                                    <TD align="center" colSpan="14"><asp:label id="Label2" runat="server"
                                            ForeColor="White" Font-Size="Large">Enter Company Name</asp:label></TD>
                                    <TD></TD>

    Saturday, May 30, 2009 9:30 AM
  • User1575881118 posted

     <%@ Page CodeBehind="addCompany.aspx.vb" Language="vb" AutoEventWireup="false" Inherits="DocManage.addCompany" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <HTML>
        <HEAD>
            <title>Arklatex Underwriters, Inc.: Documents & News Manager </title>
            <!-- saved from url=(0014)about:internet -->
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
            <style type="text/css">TD IMG { DISPLAY: block }
        </style>
            <!--Fireworks 8 Dreamweaver 8 target.  Created Mon Mar 19 09:18:50 GMT-0400 (Eastern Daylight Time) 2007-->
        </HEAD>
        <body bgcolor="#000033">
            <form id="Form1" method="post" runat="server">
            <p>&nbsp;</p>
            <table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
                <!-- fwtable fwsrc="arktemplate.png" fwbase="arktemplate.gif" fwstyle="Dreamweaver" fwdocid = "1653865989" fwnested="0" -->
                <tr>
                    <td><img src="images/spacer.gif" width="13" height="1" border="0" alt=""></td>
                    <td><img src="images/spacer.gif" width="175" height="1" border="0" alt=""></td>
                    <td><img src="images/spacer.gif" width="29" height="1" border="0" alt=""></td>
                    <td><img src="images/spacer.gif" width="145" height="1" border="0" alt=""></td>
                    <td><img src="images/spacer.gif" width="25" height="1" border="0" alt=""></td>
                    <td><img src="images/spacer.gif" width="13" height="1" border="0" alt=""></td>
                    <td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
                </tr>
                <tr>
                    <td colspan="2" background="images/arktemplate_r1_c3.gif">
                        <img name="arktemplate_r1_c1" src="images/arktemplate_r1_c1.gif" width="250" height="52"
                            border="0" id="arktemplate_r1_c1" alt="" align="middle"></td>
                    <td background="images/arktemplate_r1_c3.gif"><img name="arktemplate_r1_c3" src="images/arktemplate_r1_c3.gif" width="29" height="52"
                            border="0" id="arktemplate_r1_c3" alt=""></td>
                    <td colspan="3" background="images/arktemplate_r1_c3.gif"><img name="arktemplate_r1_c4" src="images/arktemplate_r1_c4.gif" width="183" height="52"
                            border="0" id="arktemplate_r1_c4" alt="" align="right"></td>
                    <td><img src="images/spacer.gif" width="1" height="52" border="0" alt=""></td>
                </tr>
                <tr>
                    <td background="images/arktemplate_r2_c1.gif"><img name="arktemplate_r2_c1" src="images/arktemplate_r2_c1.gif" width="13" height="186"
                            border="0" id="arktemplate_r2_c1" alt=""></td>
                    <td colspan="4" valign="top" bgcolor="#000066" align="center">
                            <TABLE id="Table1" cellSpacing="0" cellPadding="0" border="0">
                                <TR>
                                    <TD align="left" colSpan="16"></TD>
                                </TR>
                                <TR>
                                    <TD colSpan="16" align="center"><asp:label id="Label1" runat="server" ForeColor="White" Font-Bold="True" Font-Size="Large">Add
                                        Market</asp:label></TD>
                                </TR>
                                <TR>
                                    <TD><asp:label id="Label4" runat="server" ForeColor="#000066">Label</asp:label></TD>
                                    <TD colSpan="5"></TD>
                                    <TD></TD>
                                    <TD colSpan="5"></TD>
                                    <TD></TD>
                                    <TD></TD>
                                    <TD></TD>
                                    <TD><asp:label id="Label5" runat="server" ForeColor="#000066">Label</asp:label></TD>
                                </TR>
                                <TR>
                                    <TD></TD>
                                    <TD align="center" colSpan="14"><asp:label id="Label2" runat="server"
                                            ForeColor="White" Font-Size="Large">Enter Company Name</asp:label></TD>
                                    <TD></TD>

    Saturday, May 30, 2009 9:31 AM
  • User-1310737633 posted

    What error cajunzx6 is talking about?

    Is it about the open connection or failed to map path?

    Saturday, May 30, 2009 10:09 AM
  • User1575881118 posted

    this is the error message from a browser during a "live" session from where the website is hosted

    Operation must use an updateable query.

    I then checked all the permission as to read/write on where the MDB file resides. 

    This error message about not finding the path is from VS 2005 looking at the code

    I'm able to pull up the same page from my webdev server but when I try to run a query this is the error I receive

    <title>Failed to map the path '/DocView/fpdb/documents.mdb'.</title><style> body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } </style>

    Server Error in '/docmanage' Application.

    Failed to map the path '/DocView/fpdb/documents.mdb'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: Failed to map the path '/DocView/fpdb/documents.mdb'.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [InvalidOperationException: Failed to map the path '/DocView/fpdb/documents.mdb'.]
       System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +8853082
       System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath) +42
       System.Web.VirtualPath.MapPathInternal() +4
       System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping) +107
       System.Web.HttpRequest.MapPath(VirtualPath virtualPath) +37
       System.Web.HttpServerUtility.MapPath(String path) +99
       DocManage.addCompany.addRecDB() +109
       DocManage.addCompany.btnSubmit_Click(Object sender, EventArgs e) +15
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    
     

     

    Monday, June 1, 2009 9:54 AM
  • User1575881118 posted

     same folder different asp.net application throwing this error now

    The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.

    Monday, June 1, 2009 12:37 PM
  • User-821857111 posted

    Operation must use an updateable query.

    I then checked all the permission as to read/write on where the MDB file resides.

     

    It's not Read and Write permissions you need - it's MODIFY.  And to make sure you give the correct permission to the ritght user account, please read this carefully: http://www.mikesdotnetting.com/Article.aspx?ArticleID=74

     

    Tuesday, June 2, 2009 2:38 AM
  • User1575881118 posted

     Mike, I read your solution but your talking about the Application Data folder and I'm not sure under which profile to set the permission under, I was thinking about doing under All Users but wanted to ask before doing that. I'm running into this problem on 2003 server x64 OS not XP

    Tuesday, June 2, 2009 12:15 PM
  • User-821857111 posted

    I was referring to App_Data which is a special ASP.NET folder that does not allow browsing.  However, the permissions need to be applied to whichever folder you have chosen to put the mdb file.  App_Data is preferred: http://www.mikesdotnetting.com/Article.aspx?ArticleID=78.  As it says in the article, on Server 2003, the default user account under which ASP.NET runs is NETWORK SERVICE.

    I've just re-read the article, and I cannot see why you are confused.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 2, 2009 3:32 PM
  • User1575881118 posted

     quick thanks to Mike, issue solved from his post. I was over tired when I was changing permissions on the folder and of course I was editing the wrong folder.

    Wednesday, June 10, 2009 4:37 PM