Solved

ASP.NET Access MDB "Exclusive" / "Read Only"

Posted on 2008-06-12
7
1,261 Views
Last Modified: 2013-11-07
I have an issue where I have a split Access database that is accessed through both an Access front-end and a ASP.NET 2.0 web application.   The database back-end resides on the web server and the Internet Guest account along with ASPNET account have full permission under the folder security.  The ASP.NET 2.0 application accesses the Access database through an ODBC connection.  On initial setup or after a server reboot everything works fine but the moment the web application is used (i.e. someone logs in) the Access front-end gives the user a 3073 error.  The error states this query must be updatable which translates to the fact that a process of the web application has placed the db in exclusive "read-only" mode.  If one trys to open the Access database directly on the web server the "This is in read-only" message appears.  

My question how do I stop the web application (either IIS/ODBC or something else) from making the database read-only for all my other clients?  I know this a configuration issue because I have this same setup working at a different site without this issue.
0
Comment
Question by:CyberUnDead
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
7 Comments
 
LVL 15

Expert Comment

by:Solar_Flare
ID: 21773693
are you using OLEDB to open the database? if so then you can try setting the Mode in the connection string to not open it exclusively.



from http://msdn.microsoft.com/en-us/library/aa140022.aspx

Mode

A Long value (read/write) that specifies a bitmask that indicates access permissions. When read from
the Properties collection, the value returned is a number. When using the Mode property of the Connection object, you can use built-in constants, such as adModeRead. The Mode property can be one of the following values:

   Read-only (adModeRead)   1

   Write (adModeWrite)   2

   Read/Write (adModeReadWrite)   3

   Share Deny Read (adModeShareDenyRead) (Prevents others from opening in read mode.)   4

   Share Deny Write (adModeShareDenyWrite)
(Prevents others from opening in write mode.)   8

   Share Deny Exclusive (adModeShareDenyExclusive)
(Prevents others from opening in read/write mode.)   12

   Share Deny None (adModeShareDenyNone)
(Neither read nor write access is denied to others.)   16
0
 

Author Comment

by:CyberUnDead
ID: 21774506
To Solar_Flare

The web application is using an ODBC data connection. (i.e. Imports System.Data.ODBC)  future design hopefully will allow it to use more of a DAL with ODBC as one option of many data connection types.  Unfortunately right now it is limited to just ODBC.

I am thinking this is more of server/web server setting that needs tweaked.  I guess that could relate to some specific setting in the web.config.
0
 
LVL 15

Accepted Solution

by:
Solar_Flare earned 500 total points
ID: 21775191
does your connection string contain "Exclusive=1"? if so then that would cause it to be exclusive and block any other connections.

you could also try putting Exclusive=0 to forcibly make it non-exclusive.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:CyberUnDead
ID: 21779197
To Solar_Flare

I am using an web.config file for my connection strings.  It takes the following current form:

<add name="DB" connectionString="DSN=DB" providerName="System.Data.Odbc"/>

So I should try?

<add name="DB" connectionString="DSN=DB" providerName="System.Data.Odbc" Exclusive="0" />
0
 

Author Comment

by:CyberUnDead
ID: 21795996
I was a little unsure of the syntax but I came across this site: http://www.webcheatsheet.com/ASP/access_connection_strings.php.

So the proper form should be:

<add name="DB" connectionString="DSN=DB; Exclusive=0" providerName="System.Data.Odbc"  />
0
 

Author Closing Comment

by:CyberUnDead
ID: 31466712
This got me on the right track.
0
 

Author Comment

by:CyberUnDead
ID: 21803072
The solution Solar_Flare provided got me on the right track.  It turns out the "Network Service" account needed read/write permission on the database folder.  I was able to use Microsoft's/SysInternal's FileMon to track down the offending file locker.
0

Featured Post

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question