locked
Access 2007: Not a valid password RRS feed

  • Question

  • User45497663 posted

    Dear All,

    I have been googling and trying to resolve this issue for weeks now. My work is delayed and I need to resolve this issue with your valuable help asap.

    I just need to read some data from a network shared, password protected Access 2007 (.accdb) using sqlDataSource and GridView. I am using VWD 2008 EE.

    When I run the page on VWD it runs fine and i can see the data no problem, but when i deploy it on the web server i get the following error message and i cannot see the page. The server is 2003 x64 with IIS 6 and the database is on another server, 2003 x64. When I remove the password it works fine. I tried to run the page on another computer, vista, with having the database on the same computer, but I get the same error.

    Exception Details: System.Data.OleDb.OleDbException: Not a valid password.

    The connection string is:

    <add name="ConnectionString" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\server\folder\db1.accdb;Persist Security Info=True;Jet OLEDB:Database Password=12345"
       providerName="System.Data.OleDb" />

    Please Help!

    Sunday, June 5, 2011 3:31 AM

Answers

  • User1957418580 posted

    The main difference running in IIS instead of VWD is that the process running will be w3wp.exe and run as the applicationPool identity.  When running VWD, you are likely running as yourself, and you likely have more privileges than the application pool identity (usually Network Service, or if 2008 - AppPoolIdentity).  I'm not an Access expert, but you might try impersonating an escalated user as a test.  To do this, add <identity impersonate="true" userName="<name>" password="<pwd>".  See if that gets it to work.  If it does, you might try running procmon when it's failing to see if it's a file or registry permission that is missing.  Technically, I don't think it is supported to use ACE in a web application (see:  http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c06b8369-60dd-4b64-a44b-84b371ede16d&displaylang=en).

    If you want to use impersonation to connect, you can follow one of the methods here:

    306158 How to implement impersonation in an ASP.NET application
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;306158

     

    HTH

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 7, 2011 7:19 AM
  • User45497663 posted

    I found the solution.

    After I applied the impersonation in ASP.NET, btw you didn't have to supply the username and passowrd in identity tag, i did the following:

    1- modified GPO to allow the impersonated account to run as a service.

    2- Restarted the w3wp service on the web server.

    and now the page is working fine.

    Thank you all for your support. you were very helpful. i should have opened this thread long time ago instead of wasting my time with search. thank you.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 9, 2011 4:04 AM

All replies

  • User1446927574 posted

    Try the connection strings mentioned in following article and see is any works for you

    http://www.connectionstrings.com/access

    I hope this helps.

    Sunday, June 5, 2011 4:34 AM
  • User45497663 posted

    Dear nobdy, thank you for your reply. I came accross this page in my weeks of strugle and it was of no use.

    Sunday, June 5, 2011 5:53 AM
  • User1446927574 posted

    There Might be permission issue on that folder or database. 

    You can also try to access using Simple OleDbDataAdapter and see if its working fine that way. 

    Sunday, June 5, 2011 5:58 AM
  • User45497663 posted

    I dont think it is a permission issue, because i was getting a permission error before that error and ive resolved it by giving full permssions for the IIS user to the shared folder.

    Sunday, June 5, 2011 6:06 AM
  • User1446927574 posted

    Then you should try to connect to database by using OLEDBDataAdapter if works fine them move to SqlDataSource.

    Sunday, June 5, 2011 6:07 AM
  • User45497663 posted

    Ive tried to use the data adapter, and believe it or not i got the same error. i think this is an IIS issue more than ASP.NET, because the page works perfectly when i run from VWD. below is the code i used for the data adapter.

    Dim myConnection As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\server\folder\db1.accdb;Persist Security Info=True;Jet OLEDB:Database Password=12345")
    Dim myCommand As OleDbCommand = New OleDbCommand("SELECT * FROM [dbTable]", myConnection)
    Dim myDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(myCommand)
    Dim myTable = New DataTable

    myConnection.Open()
    myDataAdapter.Fill(myTable)
    GridView1.DataSource = myTable
    GridView1.DataBind()
    myConnection.Close()

    Sunday, June 5, 2011 6:25 AM
  • User1446927574 posted

    This guy has same problem but got it fixed.

    http://social.msdn.microsoft.com/Forums/en/vbgeneral/thread/f14e614b-c443-4e95-86f8-6433d742bb30

    I hope this works for you.

    Sunday, June 5, 2011 6:34 AM
  • User1867929564 posted

    http://www.daniweb.com/software-development/csharp/threads/84823

    http://www.genmaint.com/ms-access-db-over-network-share.html

    http://stackoverflow.com/questions/1731717/ms-access-db-over-network-share

    http://www.accessmonster.com/Uwe/Forum.aspx/access-security/10001/Not-a-valid-account-name-or-password-Error-3029

    Monday, June 6, 2011 5:41 AM
  • User45497663 posted

    Thank you Nobdy & KumarHarsh for the links. but i am afraid non of them helped.

    Please Help!

    Monday, June 6, 2011 7:17 AM
  • User1867929564 posted

    i) Check Firewall setting.Contact Administrator.
    ii) I still doubts permission problem.In Server give permission to that folder where db is .

    (1) If you are mapping to a mahine which is member of domain, then u must logon to the machine as a domain user and check if that user or group of which that user is member of has permissions for that share.
    (2) if the machine u r mapping to is NOT a member of domain, then u must logon to the xp machine with a user name and passwordwhich exist on the machine u r trying to map.  for this u must have same user account on the xp machine which u have on ur other machine, i dont know if the other machine is xp, 98, nt or 2000. 
    <script type="text/javascript"></script>
    iii) In server,debug your code.Check the connection string,uid and pwd.
    iv) In order to test.Remove password from mdb file.Then is it working well everywhere ?
     

     

    Monday, June 6, 2011 8:01 AM
  • User1867929564 posted

    i)Install Microsoft Office Connectivity tools on the server.

    http://forums.asp.net/p/1542343/3767823.aspx#3767823

    Monday, June 6, 2011 8:18 AM
  • User1957418580 posted

    The main difference running in IIS instead of VWD is that the process running will be w3wp.exe and run as the applicationPool identity.  When running VWD, you are likely running as yourself, and you likely have more privileges than the application pool identity (usually Network Service, or if 2008 - AppPoolIdentity).  I'm not an Access expert, but you might try impersonating an escalated user as a test.  To do this, add <identity impersonate="true" userName="<name>" password="<pwd>".  See if that gets it to work.  If it does, you might try running procmon when it's failing to see if it's a file or registry permission that is missing.  Technically, I don't think it is supported to use ACE in a web application (see:  http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c06b8369-60dd-4b64-a44b-84b371ede16d&displaylang=en).

    If you want to use impersonation to connect, you can follow one of the methods here:

    306158 How to implement impersonation in an ASP.NET application
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;306158

     

    HTH

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 7, 2011 7:19 AM
  • User45497663 posted

    cts-mgraham, you are a star.

    impersonation did solve the problem. i actually came across it in the weeks of search but i did not use it because i did not suspect it is a permission issue given that i resolved a permission error before this error as explained in my first post and that i created a user for the application pool and gave it all folder permission. in addition, "not a valid password" was more of an access error rather than a permission error.

    i shall mark your post as an answer. but there is on problem though, and you might help me with that, it only works if i impersonate my user account and it does not work if i personate another account. even if a provide all privileges to this account. i certainly dont want to use my account, so is there a way out from this?

    thank you.

    Wednesday, June 8, 2011 9:06 AM
  • User45497663 posted

    cts-mgraham,

    i just found out that the impersonated user account has to be logged on the web server in order for the page to work. in other words, if the user is not logged in, the page will through the same error message "not a valid password". this is some weird stuff.

    what can be the cause of this? is there a way I can run this account as a service to avoid having it logged on all the time?

    Help Please!

    Thursday, June 9, 2011 3:01 AM
  • User45497663 posted

    I found the solution.

    After I applied the impersonation in ASP.NET, btw you didn't have to supply the username and passowrd in identity tag, i did the following:

    1- modified GPO to allow the impersonated account to run as a service.

    2- Restarted the w3wp service on the web server.

    and now the page is working fine.

    Thank you all for your support. you were very helpful. i should have opened this thread long time ago instead of wasting my time with search. thank you.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 9, 2011 4:04 AM