tags:

views:

250

answers:

7

I'm in the early stages of a project, and it's not clear yet whether we'll need a "real" database (i.e. SQL Server et al). So I've been doing some prototyping using MS-Access, which is working fine so far. (developing in C#/VS2008/.Net 3.5/MS-Access 2000).

However, the object-relational impedance mismatch is already becoming annoying, and will only get worse as the project evolves.

I have not been able to find an ORM that will work with MS-Access. Any suggestions?

Edit - Follow Up We ended up using Fluent NHibernate, mainly because it Automaps our object model to a relational database, which has been a huge win for us. Most of the FNH code samples we found used SQLite, and this worked so well that we intend to use it for our production database. (The app is a desktop scientific data collection and analysis package).

+3  A: 

Can't give you an answer to your question, but instead of Access you might want to consider one of the following options:

  • SQL Server Express: is free and compatible with the full SQL Server
  • SQL Server Compact: also free, does not require any deployment/installation, does not support all features (e.g. no stored procedures).
M4N
Indeed. Between Express and MySQL (both free) I don't see any good reason to stick with Jet on the backend.
bobince
Plus, you'd be able to use Reporting Services.
OMG Ponies
We're concerned about installing and administering SQL Server Express on client machines, but really have no experience with it. So, we've gone with the devil we know. Is SSE really almost as easy to work with as Access?
Tom Bushell
I don't know Access very well (and only old versions). SSE is *very* similar to the standard/enterprise version of SQL Server. You can use the SQL Server Management Studio (from the full version) or a special Express version (which I don't know).
M4N
Sql server express is a much easier deployment than access.
Chris Lively
Chris - please explain how SQL Server Express is a much easier deployment that Access. If you use an Access 2000 or 2003 MDB as your tables you just drop a copy of the file on the server. Windows 2000 and newer all have the necessary files and dlls to use the MDB.
Tony Toews
Tom, SQL Server Express doesn't need to go on the client machines. Just on the server. If you are already doing the work with C#, etc, and you're dealing with a server environment then I'd suggest giong straight to SQL Server Express. If you need the data on the client systems the Access would work. LIkely SQL Lite as well.
Tony Toews
@Chris Lively says "SQL Server Express is a much easier deployment than Access" and after upsizing for the first time to SQL Server Express last month (I have only used full SQL Server before), I can only say that Chris Lively really doesn't know what s/he's talking about.
David-W-Fenton
@David-W-Fenton: What do you mean upsizing **TO** SQL Server express? My comment was that it is much easier to move **FROM** SQL Server express to SQL Server Standard or Enterprise. Moving from Access to any of those is going to be a complete PITA.
Chris Lively
@Chris Lively: You commented above "Sql server express is a much easier deployment than access" -- no mention there of lateral move between SQL Server versions, and deployment has nothing to do with migrating between any two different databases.
David-W-Fenton
+6  A: 

MSAccess files can be set up as an ODBC source on Windows machines. Almost any ORM will allow you to use ODBC. Here is a quick tutorial on how to set that up, it's outlined for Win2k but the process is the same for XP+. You also need to have MDAC installed on your box.

NHibernate seems to have native support of MSAccess as well, see here. I've never used it though. It also has an ODBC driver.. Many others support ODBC as well.

And again, as others are saying.. MSAccess does not scale... period. Installing a real database server is fairly easy, so I'd recommend SQL Server Express as others have, or even MySQL or Postgre, whatever is easier to set up.

If this is an application that you intend to deploy to clients, with each client having their own unique database, I would recommend another solution entirely, SQLite. SQLite gives you database power on an app by app basis. If you have a central database server, one of the previously mentioned solutions would be best.

snicker
-1 for "Access does not scale." It scales just fine when used properly for the user populations it is intended for. Failure to scale means the DEVELOPER is the problem, either in not knowing how to do it right or in having chosen the wrong db engine.
David-W-Fenton
@snicker - WRT to scaling - any rules of thumb as for when a dataset is too big for Access?
Tom Bushell
@Tom: there's really no hard and fast rule about it, no X number of rows in Y tables with Z columns restriction for Q users. It's going to depend on what you're doing with the data, the queries you're running, how many concurrent connections.. The real answer is when performance suffers as a result of long execution times for queries, you've gone past the limit. Mr Fenton might answer better since that seems to be his platform of choice (maybe he is a little biased, eh ;). He is correct; access *does* scale, when used in it's intended environment, but compared to a real database server...
snicker
@David-W-Fenton uhhh.. ever try running 100+ concurrent users on an Access DB? since there's **no server** involved (read: direct file access), this is near impossible to do in any reliable way, and requires some pretty open security. Access **does not scale** - even MS says it's not suitable for apps built in anything other than Access itself. "...chosen the wrong db engine" wouldn't be an issue if it *did* scale.
David Lively
I know experienced Access developers who have Accass apps in the field using a Jet/ACE back end that have 100 users or more. It can be done, it's just more work, and a good reason to upsize the back end. Of course, it's not Access that doesn't scale -- Access scales to whatever level the database you're using it with supports -- it's Jet/ACE that supports only smaller user populations. If you choose Jet/ACE, either you're making a determination that you will never need that user population, or that you'll upsize when you do. Or, you're a complete idiot.
David-W-Fenton
And I once saw a Lamborghini Countach made out of duct tape. That doesn't mean I'd be willing to take it to 190MPH on the Autobahn. The lack of server makes Access unsuitable for large-scale applications. Reminder: even MS says that Access should not be used for multiuser applications.
David Lively
@David-W-Fenton: The difference is whether you are using Access as ONLY a front end or not. If Access is simply the front end, then sure it will scale. But that isn't what everyone is talking about. The OP asked about using it as the BACKEND. Which doesn't scale. period.
Chris Lively
Guys, guys, - this is becoming an off-topic comment flame war. I've asked a new question - http://stackoverflow.com/questions/3823314/are-there-any-cases-where-ms-access-is-a-better-choice-than-ms-sql-server - that you could probably contribute to.
Tom Bushell
+2  A: 

At this stage, if you are unsure whether you need a "real" database or not, I'd skip MS Access and go straight to sql server express. It's free and still allows you to do everything you need to.

Plus, if you later decide you need to scale up, then you can without any pain.

Chris Lively
+3  A: 

There's only one scenario when choosing the Access Database Engine is a good choice: when building a self-contained Access application using Access Forms (though choosing to use Access in the first place is a questionable choice ;)

The database engine that VS2008 plays nicest with is SQL Server and you will have no problem finding an ORM that plays nice with SQL Server.

onedaywhen
+2  A: 

I recommend you to use something like Microsoft SQL Server or PostgreSQL for prototyping. If you don't want to learn specific SQL syntax and install special tools for designing database schema, you can use ORM that automatically generates database schema from your persistent classes declaration. Anyway this approach is very effective for prototyping.

Alex Kofman
Prototypes have a nasty habit of turning into a full-blown app. You should always prototype/build proof-of-concept apps using tools as close as possible to what you plan to use in production.
David Lively
+1  A: 

LLBLGen works with Access

Matt
+1  A: 

Access is just a bad, bad idea. I believe MS only includes Access in Office to keep legacy users happy.

Even if you find an ORM that will work with an Access database, with few exceptions you're locking yourself into a niche tool that likely will not work out-of-the box with a real database engine. If you decide to switch to a real database engine later on, you'll not only have to deal with migrating the database, but switching to a different ORM.

See this comparison between SQL Server Express and SQL Server Compact. The comparison document also mentions some problems with other data stores, including Access.

If you are REALLY concerned about being able to install SQL Server Express, consider SQL Server Compact:

  • it can be linked into your redistributable app. No need to install a service (which may require admin rights during install of your application); everything is taken care of when you install your app. This makes the most sense if you need the data to reside on the user's machine instead of a server, and is most analogous to using Access.

  • It's less powerful than Express (doesn't support views, triggers, stored procedures, which I consider a requirement)

  • Can be scaled up to Express or other SQL Server versions very easily

  • Suitable for small-footprint installs like tablets, mobile devices, etc.

Always keep scalability in mind when designing any application. You don't want to wind up having to write a PHP->C++ compiler if/when your app becomes successful just because you picked the wrong tool up front.

While we're at it:

The big issue with Access (or, in this case, the Jet engine, which is the part you'd really be using when integrating an Access database with a .NET app) is that there is no "server" that handles datase requests. The engine, hosted in your app, must read and write directly to a file on disk that contains the database. Whenever this happens, the file must be locked to prevent concurrent writes. Dirty reads become more common as the number of users grows, as does the potential for database corruption.

Imagine having every customer at a large restaurant trying to simultaneously enter the kitchen to write down their orders or retrieve their food. Chaos would result. There'd be a lot of broken dishes, the kitchen would be a mess, you'd be lucky to get what you ordered in any sort of edible condition. With one customer, this probably works fine. With 5, eh, maybe. With 20,50,1000? Not so much.

So, the restaurant industry introduced waiters and managers that buffer IO to the kitchen. The database server application does something roughly analogous to this by restricting access to the files on disk. Everyone gets what they want, faster and in a much more reliable way, and the data store is protected.

David Lively
SQL Server Express is NOT a replacement for Access. It's a replacement for the Jet database engine. -1 for perpetrating stupidity by using imprecise terms.
David-W-Fenton
Designing an Access app with a Jet/ACE back end for later upsizing to SQL Server is pretty simple, if you know how to write an Access app to run against SQL Server. The same things that make client/server efficient also make the Jet/ACE app efficient.
David-W-Fenton
Deploying SQL Server or Express as back end for an Access app is substantially more complex than deploying a Jet/ACE back end. Anybody who'd ever done both would know this. Your recommendations don't pass the real-world smell test -- you sound like someone who has only use SQL Server and really doesn't use Access at all, so your advice on how to use Access well shouldn't be given much value at all.
David-W-Fenton
@David-W-Fenton: The OP was talking about using Access or SQL as the DB portion with a **.Net app**. In this situation, SQL Server Express IS a direct replacement as you aren't going to be using any of the Access features such as Forms. Are you sure you read the question?
Chris Lively
Seems to me the question is about an ORM not about a db engine.
David-W-Fenton