locked
Microsoft Access database engine cannot open or wirte file - ......already opened by RRS feed

  • Question

  • User-1738998028 posted

    [Mod: Edited to mask password.]

    Hi All,

    I have to access microsoft Access which is in another computer.

    I have written below connection link and it is working fine.

     string strcon = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source= //BBB-pc/g/BBB/BBB.mdb;Jet OLEDB:Database Password=xxxx";

    BUT, when i Published and run under IIS (I added all files under IIS)

    I can see below error.

    "The microsoft access database engine cannot open or write to the file \\BBB-pc\g\BBB\BBB.mdb'. It is already opened exclusively by another user, or you need permission to view and write its data.

    I had followed most of the blog to give file permission and it is still not working.

    Please advice.

    Tuesday, August 26, 2014 5:34 AM

Answers

  • User-1738998028 posted

    Hi,

    I created same user account and password as an administrator on iis machine and other computer.

    Added in web.config

    <identity impersonate="true" userName="xxx" password="xxx">

    Above username and password must be the same as iis machine and other computer.

    it is working now.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 26, 2014 1:05 PM

All replies

  • User-1199946673 posted

    I had followed most of the blog to give file permission and it is still not working.

    You need to have MODIFY permissions on the FOLDER where the mdb file is located, because the ldb file has to be created in that folder

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

    Tuesday, August 26, 2014 5:42 AM
  • User-1738998028 posted

    HI,

    I followed what you mentioned or what described on the page. it is not working.

    My question is, it is working perfectly fine and update access database when run my application in development mode.

    But after i published my code and run under iis, it is showing errors. Why?

    Thanks for your help and please advice.

    Tuesday, August 26, 2014 6:19 AM
  • User-1199946673 posted

    I followed what you mentioned or what described on the page. it is not working.

    What do you mean by "not working'? Still the same error?

    Are you sure you gave the right user permissions? Use

    Environment.UserName

    To identify the user to give permissions, as mentioned in the article.....

    Tuesday, August 26, 2014 6:44 AM
  • User-1738998028 posted

    Hi ,

    It is the same error,  my Environment.UserName is ASUS-12. But I could not see in the file permission box.

    first time, access data file is in other pc. Not on my PC. I am connecting to other pc and doing work. I am still having error.

    If i run under IIS, i will get same error.

    please advice

    Tuesday, August 26, 2014 6:51 AM
  • User753101303 posted

    Hi,

    The message doesn't mention the account name? The problem is knowing uner which account it runs (if NETWORKSERVICE the account used to access the network file is machine$ (that is the name of the machine followed with a $). Also I would try for example a test page to check if I can create/read a simple text file (to make sure if this is a permission issue at the network share level, if I remember it could be also an issue for the temp directory on the local server).

    In this later case http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx could help to narrow down the issue.

    Finally make sure you have no way around. If I had to use an Access file, at least I would try to use a local rather than a network file if possible.

    Tuesday, August 26, 2014 7:06 AM
  • User-1738998028 posted

    Hi,

    Appreciate for your help. I will find out more. I wish I could use access locally. But, it is in client side and i cant make it work under locally. have to use as a network file.

    Thanks.

    Tuesday, August 26, 2014 7:14 AM
  • User-1738998028 posted

    Hi,

    I created same user account and password as an administrator on iis machine and other computer.

    Added in web.config

    <identity impersonate="true" userName="xxx" password="xxx">

    Above username and password must be the same as iis machine and other computer.

    it is working now.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 26, 2014 1:05 PM