Solved

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

Posted on 2008-06-12
7
1,257 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

726 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