janaka kulasekara
janaka kulasekara

Reputation: 13

System.Data.OleDb.OleDbException: Not a valid password. in MS Access database ASP.NET/C# Web app


I am stucked within a mind-crunching prob. Developed a ASP.NET/C# web app with a MS Access 2007 database.DB is in the same server (Windows server 2008 R2) which I developed the app. It has a simple GridView to show the searched results. When it runs on the localhost it works perfectly and no any error giving. When it is deployed in IIS on the server it starts giving the following error while searching the GridView.

Server Error in '/' Application.
Not a valid password.

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.Data.OleDb.OleDbException: Not a valid password.

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 (0x80040e4d): Not a valid password.]
System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +337
System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +86
   System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +31
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +76
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
System.Data.OleDb.OleDbConnection.Open() +43
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +123
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +319
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +92                  System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1618
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +21
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66
System.Web.UI.WebControls.GridView.OnPreRender(EventArgs e) +26
System.Web.UI.Control.PreRenderRecursiveInternal() +103
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496

This error is not generated while it runs on localhost

Tried for 3 days and Tried out lot of solutions on the internet, but no any progress. Pls help.

Upvotes: 0

Views: 4345

Answers (2)

Psyfo
Psyfo

Reputation: 1

I was getting the same error message when my form load executed this command

    Me.LPInfoTableAdapter.Fill(Me.EduBaseDataSetLID.LPInfo)

Then I added this line of code: -

    Me.LPInfoTableAdapter.Connection.ConnectionString = dbProvider & dbSource

This is my full code at form load event: -

    'Connect to the access database
    dbProvider = "PROVIDER=Microsoft.ACE.OLEDB.12.0;"
    dbSource = "Data Source = " & dbPath & "\School Edubase\bin\EduBase.accdb;Jet OLEDB:Database Password = P@$$w0rd"

    con.ConnectionString = dbProvider & dbSource

    Me.LPInfoTableAdapter.Connection.ConnectionString = dbProvider & dbSource
    Me.LPInfoTableAdapter.Fill(Me.EduBaseDataSetLID.LPInfo)

I'm not an expert and don't even know how I solved my issue, but I did. So, Hope this works for you.

Upvotes: 0

Sanket Patel
Sanket Patel

Reputation: 1160

It is permission related issue.You should update web.config identity tag with valid username/password Or change group policy. Please see below links for more details.

http://forums.asp.net/t/1686842.aspx?Access+2007+Not+a+valid+password

and And this is helpful.

Upvotes: 1

Related Questions