Solved

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

Posted on 2008-06-12
7
1,251 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
  • 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

776 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