locked
Problem with connecting MS Access DB 2003 with ASP.net and IIS 7 RRS feed

  • Question

  • User293717075 posted

    i have problem when connecting MS Access 2003, this is the condition, 

    i have a website running under Windows Server 2008 64bit, which mean using IIS 7, and i have Access DB in other server (this DB is used by other old application),

    this is the connection string i used : "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\servername\folder\abc.mdb;Persist Security Info=False;Jet OLEDB:Database Password="

    i want to connect to this DB but i got error message :

    "The Microsoft Jet database engine cannot open the file \\servername\folder\abc.mdb. It is already opened exclusively by another user, or you need permission to view its data"

    then i change the connection string : "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\servername\folder\abc.mdb;Mode=Share Exclusive;Persist Security Info=False;Jet OLEDB:Database Password="

    but still don't work,

    i googling, and got the info that i must granted the security of IIS_Machinename user in the folder and the DB file, but my db is in different server with the wesbite, is there any other solution? thanks

    Thursday, May 5, 2011 11:54 PM

Answers

All replies

  • User1341311230 posted

    Use the following string

    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= \database.mdb;User Id=;Password="

    Or

    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet OLEDB:Database Password=MyDbPassword; // with password

    Friday, May 6, 2011 8:29 AM
  • User293717075 posted

    Use the following string

    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= \database.mdb;User Id=;Password="

    Or

    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet OLEDB:Database Password=MyDbPassword; // with password

     

    can not do like that, because ms acces is in different PC

    Monday, May 9, 2011 3:54 AM
  • User-1199946673 posted

    googling, and got the info that i must granted the security of IIS_Machinename user in the folder and the DB file, but my db is in different server with the wesbite,

    That's correct. Because when opening an MDB file, a LDB file is created. This means that the (Windows) user that needs to access the database needs to have Modify rights on the folder where the Access database is located...

    http://www.mikesdotnetting.com/Article/74/Solving-the-Operation-Must-Use-An-Updateable-Query-error

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 9, 2011 6:59 AM