Introduction:
Here I will explain “The Microsoft Office Access
database engine cannot open or write to the file ''. It is already opened
exclusively by another user, or you need permission to view and write its data.”
problem solution in asp.net
using C# and VB.NET.
Description:
In one application I got requirement like Read or Import data from excel sheet to gridview and upload excel data to SQL database once implementation
completed I tested it in local everything working fine. After I deployed
application in server machine and tried to run then I got an error like "The
Microsoft Office Access database engine cannot open or write to the file ''. It
is already opened exclusively by another user, or you need permission to view
and write its data”.
To solve this problem we need to grant the NETWORK
SERVICE account modify permission on my folder where our excel files will sit
for that follow below steps.
1.
Select your folder >> Right
click on folder and select properties like as shown below
2.
Once properties opened >> Select
Security Tab >> In that click on Edit button to change the
permissions like as shown below
3.
Once you click on Edit button another
window will open in that select Add button like as shown below
4.
Now click on Add button >>
Another window will open in that enter “Network Service” as name >>
click on Check Names like as shown below
5.
Once “Network Service” added set
permissions for Network Service and click ok like as show below
Once set network service permissions run your application i hope this will fix your
problem.
|
If you enjoyed this post, please support the blog below. It's FREE!
Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.
|
Subscribe by RSS
Subscribe by Email
|
|
|
6 comments :
Hai sir,
i did same, but i am getting same error sir
sir,
i did same, but i am getting same error sir
SORRY SIR ITS STILL NOT WORKING
sorry sir but its not working
Hi Suresh,
I am getting this error , please help me
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
Hi All,
You will definitely get this error since the file is posted on file upload control it is used by it ... so it says 'opened exclusively'.The solution is that u first save the file on server then read it.