Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open access database read only

Status
Not open for further replies.

PapaSmurf

IS-IT--Management
May 16, 2001
48
GB
I have a simple Access MDB that is only ever administered by one person. Other users have the data appear via the local intranet using ASP.NET.

Although this works fine, whenever a user views the web page, the server creates a lockfile in the same location as the MDB. This seems to stay there until manually deleted, but until this time access won't let the main user change any data within.

Is there not some way of opening an access mdb file as read only? (I know I know, SQL would be better, but overkill for what i need.....)

Ben
 
Hi
It seems to me there might be three issues
1. MS Access should still let you modify data in the database while a table is locked. The only thing it might not let you do is open a table in design view. Is this what you are experiencing? If that is the case, you might consider using an offline copy of the mdb file for development and dropping it in when you are done. Since your web users are accessing the db in read only mode, you don't have to worry about changes they've made to the file.

2. Yes, in the connection string, if you use the oledb provider for jet 3.51 or 4, there is an option to set the mode to read, but as far as I can tell, the lockfile and table design problem still persists.

3. When I try it with Access 97/Jet 3.51, the lockfile only persists if you do not close the connection properly. In asp.net, the idea is to operate on a minimum connection strategy. Open the connection, get your data, and then close the connection. If you don't explicitly close the connection, then you don't know when it will get closed.

Hope this helps

Mark [openup]
 
Mark, many thanks for your help but I have solved the issue.

I knew about

Rdr=cmd.executeReader(CommandBehavior.closeconnection)

But unfortunately failed to spell "Behavoir" right the first time! Took me a few hours to realise my mistake.

The lockfile now dissappears as soon as the web page loads.

Thanks again! Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top