locked
System.Data.OleDb.OleDbException: Unspecified error RRS feed

  • Question

  • User-455785704 posted

    Hi Guys, 

    I am stumped. I have a simple update query to a access database. Works perfectly on my localhost but when I upload it to the server it displays this. The weird thing in the "

    monstababy.MailingList.btnSubmit_Click(Object sender, EventArgs e) in C:\inetpub\wwwroot\monstababy\monstababy\monstababy\MailingList.aspx.cs:26" mention of my 
    local host settings on the server. I have spoken to my host and they have set permissions for the data folder etc but this still prevails. I am positive it 
    was working fine as well and now it doesn't.

    Any ideas?


    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: 

    [OleDbException (0x80004005): Unspecified error]
       System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +969373
       System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +86
       System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +29
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +4863644
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
       System.Data.OleDb.OleDbConnection.Open() +40
       monstababy.dsMailTableAdapters.tblMailTableAdapter.Insert(String fldFirstName, String fldLastName, String fldEmail, String fldMobile) in C:\inetpub\wwwroot\monstababy\monstababy\monstababy\dsMail.Designer.cs:984
       monstababy.MailingList.btnSubmit_Click(Object sender, EventArgs e) in C:\inetpub\wwwroot\monstababy\monstababy\monstababy\MailingList.aspx.cs:26
       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
    Thursday, July 29, 2010 10:44 PM

Answers

  • User-455785704 posted

    I solved it. I don't know whether some settings had changed on the server side or I am just losing my mind but I updated the connection string with the 5th line.



    <connectionStrings>  
       <add name="monstadBConnectionString" 
         connectionString="Provider=Microsoft.Jet.OLEDB.4.0;
         Data Source=E:\hshome\cdlitcon\data\monstadB.mdb
          ; User Id=admin; Password=;" 
         providerName="System.Data.OleDb" />
    </connectionStrings>  


    Thanks


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, July 30, 2010 9:45 PM

All replies

  • User-1199946673 posted

    The error occors in

    C:\inetpub\wwwroot\monstababy\monstababy\monstababy\MailingList.aspx.cs:26

    Please show us your code, otherwise we need to guess?

    Friday, July 30, 2010 3:29 PM
  • User-455785704 posted

    Sorry, i should have known that.

    Page code:

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:monstadBConnectionString %>" 
                        DeleteCommand="DELETE FROM [tblMail] WHERE [fldMailKey] = ?" InsertCommand="INSERT INTO [tblMail] ([fldFirstName], [fldLastName], [fldEmail], [fldMobile], [fldMailKey]) VALUES (?, ?, ?, ?, ?)" 
                        ProviderName="<%$ ConnectionStrings:monstadBConnectionString.ProviderName %>" SelectCommand="SELECT [fldFirstName], [fldLastName], [fldEmail], [fldMobile], [fldMailKey] FROM [tblMail]" 
                        UpdateCommand="UPDATE [tblMail] SET [fldFirstName] = ?, [fldLastName] = ?, [fldEmail] = ?, [fldMobile] = ? WHERE [fldMailKey] = ?">
                    <DeleteParameters>
                        <asp:Parameter Name="fldMailKey" Type="Int32" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="fldFirstName" Type="String" />
                        <asp:Parameter Name="fldLastName" Type="String" />
                        <asp:Parameter Name="fldEmail" Type="String" />
                        <asp:Parameter Name="fldMobile" Type="String" />
                        <asp:Parameter Name="fldMailKey" Type="Int32" />
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:Parameter Name="fldFirstName" Type="String" />
                        <asp:Parameter Name="fldLastName" Type="String" />
                        <asp:Parameter Name="fldEmail" Type="String" />
                        <asp:Parameter Name="fldMobile" Type="String" />
                        <asp:Parameter Name="fldMailKey" Type="Int32" />
                    </InsertParameters>
                    </asp:SqlDataSource>
                </p>
                <table id="MailingTable" class="MailingTbl">
                      <tr>
                        <td colspan="2" class="MailingTitle">
                        JOIN THE MONSTABABY MAILING LIST
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="MailingDesc">
                        <p>You are about to join up to the Monstababy mailing list. Rest assured you can unsubscribe at anytime from the list and never will any 
                        information be passed on or sold to other parties.</p>
                        <p>Joining up to the MonstaBaby mailing list will get you:</p>
                        <ul>
                        <li>Emails about up coming gigs</li>
                        <li>News alerts and information about the band</li>
                        <li>Chances to get cheap drinks and pre order tickets</li>
                        <li>More offers will be available over time ....</li>
                        </ul>
                        <p>If you wish to proceed, please fill in the details below and press submit.</p>
                        <br /><br />
                        <p style="text-align:right; margin-right:20px;"><b>Thank You<br />MonstaBaby
                            </b></p>
                            <p style="text-align:center;" ><asp:Label ID="lblThanks" runat="server" Text=""></asp:Label></p>
                                                
                        </td>
                    </tr>
                    <tr>
                        <td class="MailingLeft">First Name
                        </td>
                        <td class="MailingRight">
                            <asp:TextBox ID="txtFirst" CssClass="MailtxtBox" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                     <tr>
                        <td class="MailingLeft">Surname
                        </td>
                        <td class="MailingRight">
                            <asp:TextBox ID="txtSurname" CssClass="MailtxtBox" runat="server"></asp:TextBox>
                         </td>
                    </tr>
                     <tr>
                        <td class="MailingLeft">Email
                        </td>
                        <td class="MailingRight">
                            <asp:TextBox ID="txtEmail" CssClass="MailtxtBox" runat="server"></asp:TextBox>
                         </td>
                    </tr>
                     <tr>
                        <td class="MailingLeft">Mobile
                        </td>
                        <td class="MailingRight">
                            <asp:TextBox ID="txtMobile" CssClass="MailtxtBox" runat="server"></asp:TextBox>
                         </td>
                    </tr>
                    <tr>
                        <td class="MailingLeft">
                        </td>
                        <td  class="MailingRight">
                            <asp:Button ID="btnSubmit" runat="server" Text="Button" onclick="btnSubmit_Click" />


    code behind:


    namespace monstababy
    {
        public partial class MailingList : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                
    
            }
            
    
            protected void btnSubmit_Click(object sender, EventArgs e)
            {
                dsMailTableAdapters.tblMailTableAdapter tA = new monstababy.dsMailTableAdapters.tblMailTableAdapter();
                tA.Insert(txtFirst.Text , txtSurname.Text, txtEmail.Text , txtMobile.Text );
                
                lblThanks.Text = "Thanks," + txtFirst.Text + " " + txtSurname.Text + " your details have been added.  :o)";
                
                txtFirst.Text = "";
                txtSurname.Text = "";
                txtEmail.Text = "";
                txtMobile.Text = "";
            }   
        }
    }


    Web provider details:

    	<connectionStrings>
    
        <add name="monstadBConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\hshome\cdlitcon\data\monstadB.mdb"
      providerName="System.Data.OleDb" /> 
        
      </connectionStrings>



    Friday, July 30, 2010 8:39 PM
  • User-455785704 posted

    I solved it. I don't know whether some settings had changed on the server side or I am just losing my mind but I updated the connection string with the 5th line.



    <connectionStrings>  
       <add name="monstadBConnectionString" 
         connectionString="Provider=Microsoft.Jet.OLEDB.4.0;
         Data Source=E:\hshome\cdlitcon\data\monstadB.mdb
          ; User Id=admin; Password=;" 
         providerName="System.Data.OleDb" />
    </connectionStrings>  


    Thanks


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, July 30, 2010 9:45 PM