Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 Development Tools
 C#, Java and Access Locking
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

14 Posts

Posted - 03/29/2013 :  01:02:38  Show Profile  Reply with Quote
Couldn't really find a best place to put this, so I ended up in this section.

So I've an Access 2007 database of TV listings that I fill by scraping and parsing a website every morning using a small C# executable - works fine.

Then I have a java program called PS3 Media Server where I've written an add-on to query the database to show what's on a particular network at that moment, and then do some voodoo to watch that particular show on my PS3 (a cheap-geek's program guide) - works fine.

Finally, I've written a C#/ website (W2K3/IIS6/.NET 2.0) that also queries the DB and displays some condensed data about TV shows on my Cisco IP phones (because I can, that's why). - works fine if the java program is not running. Otherwise, I get a nice

"Could not use 'd:\mdbdata\ShawTVListings.accdb'; file already in use"

There's nothing fancy about the connection strings in either program, and it's interesting that my scraper/parser/inserter program works regardless the state of the java program. In fact, in both the java program and page, I've explicitly set readonly

DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};
DBQ=d:/mdbdata/ShawTVListings.accdb;READONLY=true", "", "");

OleDbConnection.ConnectionString = string.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};
Persist Security Info=False;", @"d:\mdbdata\ShawTVListings.accdb");

Thinking it was some slapfight of access rights between Administrator (the Java and scraper user instance) and Anonymous IIS User (what the app runs under, even though it had write access to the database and its folder), I set my web app to run as Administrator (don't worry, it's not accessible from outside) - no difference.


Edited by - Nexzus on 03/29/2013 01:18:18

The Chadinator

1974 Posts

Posted - 03/30/2013 :  01:24:44  Show Profile  Visit chadmat's Homepage  Reply with Quote
Why not use SQL Express?

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000