views:

1722

answers:

9

A few questions on MS Access databases -

Size: Are there limits to the size of an access database? The reason i ask is that we have an access database that has a few simple tables. The size of the db is about 1GB. When I do a query on it, i see it taking over 10 minutes to run.

With proper indexing, should MS Access be able to handle this or are there fundamental limitations to the technology.

This is MS Access XP.

Also, does MS Access support db transactions, commit and rollback?

+4  A: 

You will get many varied answers here, but in MY OPINION access is just not there as a scalable solution. It doesn't handle multi-user situations very well, as you start to approach 1Gb in size, stability starts to become a MAJOR concern, and in reality it just doesn't have the performance.

In regards to transaction support, please see this Microsoft Article.

Also, here is a article that actually points out a good majority of limitations of access.

Mitchel Sellers
Stability in a well designed access database will not suffer at 1GB
JohnFx
there's a limit of 2GB per DB in Access - and I've personally seen performance start to degrade far sooner, especially once you get a few users at the same time
warren
A: 

Personally, I've found the 'usable' limit to be in the couple hundred megabyte range.

Access is designed and meant for small databases. For large ones, ie ones beyond just something you and a couple-few people are using, you should be looking at a "real" RDBMS like SQL Server, ORacle, DB2, MySQL, etc.

EDIT - see http://www.blueclaw-db.com/vb_transaction_processing.htm for a way to handle transactions with Access. Apparently it's not native.

warren
A: 

The maximum size of an Access database is 2GB. You can get around this by using linked tables in other files, but it's probably time to use a more robust database if you are already experiencing performance issues.

My recommendation would be to look at SQL Server Compact, which is a no-cost, file-based database or, better yet, SQL Server Express, which is a no-cost, "lite" version of SQL Server that will support multiple users and interoperability with SQL Server. Both limit you to 4GB databases.

All of the products mentioned, including Access, support transactions.

Ben Hoffstein
+2  A: 

In answer -

Size: The maximum size of an Access database is 2GB.

Transactions: Transactions are fully supported by the underlying JET database engine.

From past experience I'm inclined to say that you're probably hitting the maximum usable size and should maybe consider upsizing to SQL Server Express.

Kev
A: 

I'm not sure if they are still there in the XP version, but in Access 97, there were compact and repair options. If these are still options, they may help.

Michael
A: 

While this is going back many years at a time when the cost of entry into a SQL Server installation was as prohibitive as Oracle, one of my clients was using Access to try to manage an inbound call center.

We are talking about VLDB-very large database concepts 40 million rows. This was during the era of telephone companies rolling out caller id and offering their subscribers a way to receive a free caller id device. Because of cost contraints they had to ignore my pleas to make the SQL Server investment.

In practice it seemed that Access toppled at about 800MB. We partitioned tables into multiple Access databases to handle the load. Believe it or not, it worked beautifully. The client was grateful.

In practice given the availability of the SQL Express, I too would recommend going that route.

Bill
If this was in the days of Access 97 (Jet 3.5), then the limit for an MDB was 1GB. 800MBs would be a dangerous thing with a 1GB upper limit. Nowadays, it oughtn't be such a big deal unless there is regular growth that extrapolates out to exceed 2GBs in a couple of years.
David-W-Fenton
A: 

My impression from reading the Access newsgroups over the years is that ACE/Jet engine (.accdb, .mdb or .mde file) is only recommended nowadays when using MS Access as a RAD forms-based development environment using bound forms. If you don't have an Access front end then there are few arguments in favour of a ACE/Jet back end when considering the much more scalable (and capable) alternatives: SQL Server Express or SQL Server Compact Edition for MS shops, MySQL, etc.

As reagrds transaction support in the ACE/Jet engine, yes it is present and native. Another answer linked to an article about using transactions via DAO: note that many aspects of DAO are limited because its development lags that of the engine and transactions is one example. Happily, you can use SQL DCL: BEGIN TRANSACTION, COMMIT TRANSACTION, ROLLBACK TRANSACTION, etc to acomplish things not possible with DAO e.g. nested transactions. SQL DCL requires the Access interface to be in ANSI-92 Query Mode; using ADO will work because ADO uses this mode natively. For more details, see:

Advanced Microsoft Jet SQL for Access 2000

onedaywhen
My guess is that DAO will no longer be lagging now that the Access team has taken over its own version of the Jet database engine. And the only reason DAO ever lagged was because MS purposely chose not to keep up with the features of Jet 4 because they wanted everybody to use ADO. Times change.
David-W-Fenton
I sincerely hope you've guessed correctly and the Access team beef up DAO. But as things stand, DAO is still missing much of the new-to-Jet-4.0 features (row level locking, CHECK constraints, nested transactions, etc) and -- gulp -- ADO may still be required until then.
onedaywhen
I roughly agree with onedaywhen. I just wonder why I nearly never see people recommend DB2 as an alternative. I do not wish to advocate for DB2, since I know very little about it. However it seems robust, has NO size limit and exists as a free version as well.
iDevlop
@iDevlop: DB2 is highly regarded by the SQL academic community. Many of us in the SO community recommend only what we use in our day jobs, usually determined by employers' procurement policies. I am myself free to use SQL Server or Oracle; purchasing anything else would be difficult to justify (financially, philosophically, etc) and anything open source rarely gets past the legal department.
onedaywhen
A: 

Jet can be a very good data store for any number of desktop development platforms, not just with Access itself. It's always been a first choice for VB developers and still is (for good reason).

A 1GB MDB that is not expected to grow a lot ought not be a problem in terms of speed or reliability. If it's slow, then you haven't indexed it right, or you're writing very inefficient SQL. An example of inefficient SQL would be applying WHERE clauses to expressions, which therefore can't use indexes -- an example would be

WHERE Year([MyTable].[MyDate]) = 2002

as opposed to

WHERE MyTable.MyDate Between #1/1/2002# And #12/31/2002#

If you're having stability issues (i.e., recurrent corruption), that's a problem that needs to be addressed -- it's usually due to human error, hardware problems or software issues (like AV software interfering with internal Jet write operations).

But the key determinant is how fast the MDB is growing. If you extrapolate out the historical growth rate and approach 2GBs within 5 years, I'd say you need to upsize soon. If it's more like 10 years, you should probably do it anyway. If it's 20 years, then, not so much.

David-W-Fenton
"Microsoft [years ago] deprecated the Microsoft Jet Engine" (http://msdn.microsoft.com/en-us/library/ms692882.aspx) should be enough of a reason to avoid Jet for non-Access projects. Another is the trend for dropping major features of value to non-Access applications: security, replication, etc.
onedaywhen
David-W-Fenton
A: 

Sorry, mis posted

Scott Jackson