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.
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).
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.
Member
62 Points
311 Posts
Microsoft Access database engine cannot open or wirte file - ......already opened by
Aug 26, 2014 05:34 AM|supermanNUM1|LINK
[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.
All-Star
25756 Points
7014 Posts
Re: Microsoft Access database engine cannot open or wirte file - ......already opened by
Aug 26, 2014 05:42 AM|hans_v|LINK
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
Member
62 Points
311 Posts
Re: Microsoft Access database engine cannot open or wirte file - ......already opened by
Aug 26, 2014 06:19 AM|supermanNUM1|LINK
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.
All-Star
25756 Points
7014 Posts
Re: Microsoft Access database engine cannot open or wirte file - ......already opened by
Aug 26, 2014 06:44 AM|hans_v|LINK
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.....
Member
62 Points
311 Posts
Re: Microsoft Access database engine cannot open or wirte file - ......already opened by
Aug 26, 2014 06:51 AM|supermanNUM1|LINK
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
All-Star
48570 Points
18086 Posts
Re: Microsoft Access database engine cannot open or wirte file - ......already opened by
Aug 26, 2014 07:06 AM|PatriceSc|LINK
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.
Member
62 Points
311 Posts
Re: Microsoft Access database engine cannot open or wirte file - ......already opened by
Aug 26, 2014 07:14 AM|supermanNUM1|LINK
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.
Member
62 Points
311 Posts
Re: Microsoft Access database engine cannot open or wirte file - ......already opened by
Aug 26, 2014 01:05 PM|supermanNUM1|LINK
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.