locked
Help: Can't Update Ms Access DB record on Web Server (VS 2005) RRS feed

  • Question

  • User-569196907 posted

    Hi experts,

     This is my first time using Visual Studio 2005 with Dot Net Framework 2.0 building aspx databinding files. I have created a MS Acess (file version 2003) database and uses  DetailView function - insert, edit, delete ready available function. The insert, edit and delete function is working fine on my localhost webpage but when i posted all the files to my web server and i got the following error. Can anyone assist me here? Billion thanks

    ------------------------------------------------------File script------------------------------------------------------------ 

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default3.aspx.vb" Inherits="Default3" %>

    <!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 runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:AdRotator ID="AdRotator1" runat="server" DataSourceID="AccessDataSource1" Style="z-index: 100;
                left: 0px; ; top: 0px" />
            <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/guestbook.mdb"
                DeleteCommand="DELETE FROM [Guestbook] WHERE [ID] = ?" InsertCommand="INSERT INTO [Guestbook] ([Name], [EMail], [URL], [Comment]) VALUES (?, ?, ?, ?)"
                SelectCommand="SELECT * FROM [Guestbook]" UpdateCommand="UPDATE [Guestbook] SET [Name] = ?, [EMail] = ?, [URL] = ?, [Comment] = ? WHERE [ID] = ?">
                <DeleteParameters>
                    <asp:Parameter Name="ID" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="Name" Type="String" />
                    <asp:Parameter Name="EMail" Type="String" />
                    <asp:Parameter Name="URL" Type="String" />
                    <asp:Parameter Name="Comment" Type="String" />
                    <asp:Parameter Name="ID" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="Name" Type="String" />
                    <asp:Parameter Name="EMail" Type="String" />
                    <asp:Parameter Name="URL" Type="String" />
                    <asp:Parameter Name="Comment" Type="String" />
                </InsertParameters>
            </asp:AccessDataSource>
            <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False"
                DataKeyNames="ID" DataSourceID="AccessDataSource1" Height="50px" Style="z-index: 102;
                left: 63px; ; top: 90px" Width="299px">
                <Fields>
                    <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
                        SortExpression="ID" />
                    <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                    <asp:BoundField DataField="EMail" HeaderText="EMail" SortExpression="EMail" />
                    <asp:BoundField DataField="URL" HeaderText="URL" SortExpression="URL" />
                    <asp:BoundField DataField="Comment" HeaderText="Comment" SortExpression="Comment" />
                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
                </Fields>
            </asp:DetailsView>
       
        </div>
        </form>
    </body>
    </html>

    ----------------------------------------------Error Message on the server---------------------------------------------------------------   

    Runtime Error

    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

    <!-- Web.Config Configuration File -->
    
    <configuration>
        <system.web>
            <customErrors mode="Off"/>
        </system.web>
    </configuration>

     

    From: Josephine

    Thursday, September 11, 2008 10:34 PM

Answers

  • User-821857111 posted

     

    I had my web admin to create Internet Guest Account[WSCSEW04\IUSR_WSCSEW04] and granted these access

    It's not that account.  ASP.NET runs under the NETWORK SERVICE account on Win2k3.  Please read the link I posted some days ago where this is explained clearly.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 15, 2008 2:25 AM

All replies

  • User1810860878 posted

    Follow the direction specified in the error message and change your web.config customError settings so you can see the actual error, that would be most helpful.  Without any other informaiton based on what you said I would make sure the asp.net worker process has read/write permissons on the directory where the database lives.

    Thursday, September 11, 2008 11:08 PM
  • User-821857111 posted

    When you have followed the instructions to enable the specific error message to be viewable on remote machines, it's most likely that you will need to read this to resolve the problem: http://www.mikesdotnetting.com/Article.aspx?ArticleID=74

     

    Friday, September 12, 2008 2:13 AM
  • User-569196907 posted

    I am getting this error message "Operation must use an updateable query." on server but meanwhile the local drive is working. I am getting the system administrator to set security in App_Data folder as well the MS Access database. Is this what i am supposed to do?

     

    Friday, September 12, 2008 4:34 AM
  • User-821857111 posted

    I am getting the system administrator to set security in App_Data folder as well the MS Access database. Is this what i am supposed to do?
     

    You only need to get it done to the App_Data folder, but yes. Follow the link I posted for more details.

    Friday, September 12, 2008 8:51 AM
  • User-569196907 posted
    HI,

    Thanks for advice. I had my web admin to create Internet Guest Account[WSCSEW04\IUSR_WSCSEW04] and granted these access (Modify, read & execute, list folder Contents, read, write) but I am still getting "Operation must use an updateable query" error?

    Btw, do i need to set up any DSN or odbc connection or any other connection?
    Or do you have any ready sample on web server asp dot net 2.0 with MS Access 2003 applications available for me to refer? Billion thanks

    From: Josephine
    Sunday, September 14, 2008 10:54 PM
  • User-821857111 posted

     

    I had my web admin to create Internet Guest Account[WSCSEW04\IUSR_WSCSEW04] and granted these access

    It's not that account.  ASP.NET runs under the NETWORK SERVICE account on Win2k3.  Please read the link I posted some days ago where this is explained clearly.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 15, 2008 2:25 AM
  • User-569196907 posted

    Hi Mike,

     Thanks. The web server asp.net page update statement is working now. I also had just added <identity impersonate="true" /> on my web.config file. Billion thanks [;)]

    Monday, September 15, 2008 2:50 AM