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

 All Forums
 Development Tools
 ASP.NET
 C#, Java and Access Locking

Author  Topic 

Nexzus
Starting Member

14 Posts

Posted - 2013-03-29 : 01:02:38
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#/ASP.net 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"
error.

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 ASP.net page, I've explicitly set readonly

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


C#/ASP.net:
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 ASP.net 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.

Thoughts?

chadmat
The Chadinator

1974 Posts

Posted - 2013-03-30 : 01:24:44
Why not use SQL Express?

-Chad
Go to Top of Page
   

- Advertisement -