views:

1547

answers:

13

I have a product designed to be a desktop product using MS Access file as a DB.

Now, some users need to install it in a few PCs (let's say 2 or 3) and SHARE the database.

I thought to place the MS Access file in a shared folder and access it from the PC, but... the JET Engine is designed for multiple user access?

Any tips or things to be aware of doing this?

EDIT: The app is a .net one, using the database as storage (not using the database as frontend)

+3  A: 

Don't do it... the Jet database claims to be able to support multiple users, but it is incredibly easy to use the upsizing wizard to convert your Access file to a Sql Express database. That database file could EASILY become locked by a user or admin, and all of your users would be unable to use the database.

... and Sql Express is free. Your upgrade path from there to a full instance of Sql Server or some other commercial database is simple.

Jeff Fritz
While I agree with many other posters that using Access as a backend to .net is possible (I've done it myself) I would only do it for business policy reasons. If you're not prevented by politics, there are other better tools available for free.
mavnn
A: 

Jet does not have the sophisticated lock logic required to support multi-user scenarios. You can get away with using it if your application is mostly reads and low-contention.

I've seen websites support many users, but I would recommend SQL Express unless you have a compelling reason to choose Jet.

Jim
+2  A: 

Yes, it supports access by multiple (that is, a small, workgroup-sized, number) of users over a network file share. However, the file share architecture is simply not ideal for supporting simultaneous writing to a file by multiple users. A client/server database system (SQL Server, etc.) generally provides better performance, security, and reliability.

binarycoder
+5  A: 

It's perfectly feasible to do this; but you MUST split the database into a front end (with forms, queries, code) and a back end (data only). Every user has to have the front end on their own computer, linking to the shared back end.

It will be slow as Jet generates a ton of network traffic. Microsoft is also gradually deprecating Access as a development tool. Access 2007, for instance, has a far less sophisticated security model than Access 2003.

As a long time Access developer I am gradually moving away from Access.

dsteele
I disagree with your comments about security. Yes, ULS has been removed from the ACCDB file format, but that's because of the reasonable permission that controlling user access at that level is a back-end task and really only reliablly accomplished with a server back end, e.g., SQL Server. Yes, I would miss ULS, but it's not removed from A2007 itself (or from ACE) just from the ACCDB file format.
David-W-Fenton
+1 for reiterating to split the application into its client-front-end part and leaving the data on a back-end database.
Renaud Bompuis
+1  A: 

As a sysadmin, please don't use Access for anything multi-user. Do what Jeff Fritz suggests and use a database that is designed for multi-user access. You may think that your little app is only going to be shared between a few people, but I guarantee you that it'll have a hundred users and fifty new features by the end of the year. And if those are all Access, rather than VB/SQL Express, your Ops people will break into your house one night and slit your throat.

Access isn't a client-server app, and provides very little in the way of backup/restore, or any automation whatsoever. Not to mention the interface and the DB are very tightly coupled... so if you ever want to turn this into a web app, or make any serious changes, your world will be filled with pain.

Don Werve
Thanks for the referral Don!
Jeff Fritz
You can decouple the interface and the data quite easily, but on the other hand, 'your world will be filled with pain' describes life as an Access developer fairly well :)
dsteele
I'm fairly certain that's actually the mission statement for the Access team over at Microsoft...
Don Werve
+5  A: 

With 2 or 3 users on a reliable local network you should be fine, as long as you back the network drive up often.

Avoid any bit/bool fields in your tables - Jet has some nasty corruption issues with multiple access to them.

Also bear in mind that all locking in Access is optimistic: you will get dirty reads occasionally.

MS Access is designed for small office scenarios like this: non-critical light office use that you can set up with the minimum of programming.

Expect the data file to get corrupted every now and then - back up regularly.

Keith
You can choose you locking type -- optimistic is only Access's default for Jet. Also, *don't* expect corruption unless you've got a substandard network and you're a bad programmer.
David-W-Fenton
Nah - always expect corruption with Jet. Even the very best set up machines connecting to the very best networks will have the occasional glitch, and when they do you get Access file corruptions.
Keith
I have dozens of clients using my Access apps on a daily basis and there hasn't been a single corruption in almost 5 years. If you do it right, you don't have corruption.
David-W-Fenton
I have a split Access 2007 app with about 20-30 users simultaneously connected to it all day long doing things like Purchase Orders, delivery management, stock management, quality control, Bill of Materials, Part reference management, plenty of reporting, etc.I haven't had any database corruption to speak of. The whole thing has been incredibly solid.
Renaud Bompuis
I have several clients running between 10 and 30 users all day long. Haven't had a corruption in years and have never lost data. Backends are around 300 Mbs in size with between 120 and 160 6ables in each. These have been in growing use for almost ten years no. And yes, they should be upsized and will be some time soon.
Tony Toews
+14  A: 

There is so much misinformation in the answers in this thread that I don't know where to start. I just spent 4 points in reputation voting down the answers with misleading and wrong information in them.

  1. the Jet database engine (which is all that's involved here, as the OP clarified with an edit) is by default multi-user -- it was built from the ground up to be that way.

  2. sharing a Jet data store is very reliable when the network is not substandard. This means not a WAN and not wireless, because the bandwidth has to be sufficient for Jet to maintain the LDB file (for multi-user locking), which means a ping by your local PC's instance of the Jet database engine once per second (with default settings), and because Jet can't recover from a dropped connection (which is quite common in a wireless environment).

  3. the situation where Access falls down is when a front-end Access application MDB is shared (which is not the case for this poster). The reason it fails is because you're sharing things that can't be reliably shared and have no reason to be shared. Because of the way Access objects are stored in an MDB file (the entire Access project is stored in a single BLOB field in one record in one of the system tables), it's very prone to corruption if multiple users open it. In my estimation, sharing an Access front end (or an unsplit MDB with the tables and forms/reports/etc. all in one MDB) is the source for 99.99% of corruptions of Access/Jet files.

My basic answer to the OP's question is that, yes, Jet would be a great data store for an app of that size. However, if there's any possibility at all for the user population to grow above 25, then it might be better to start off from scratch with a database engine that is more robust at higher user populations.

David-W-Fenton
It's been done so many times, by so many develpers, in so many successful commercial applications, that I have a hard time believing there are still people who don't think it's possible. Of course you can design it badly and the wheels will fall off. But that's your job as a developer. The benefit for the users is that it's less likely they'll end up needing professional DBA help just for the database apart from the application.
le dorfier
On a single PC (not SERVER), for a group of less than 5 users, Access will work. A single file on a network share can be locked by ANY process, not just Access. If a backup operation, or a copy, or any other file operation occurs on your MDB file you will lose connectivity. The question is: how reliable does your solution need to be?
Jeff Fritz
+2  A: 

The ACE/Jet engine is a great piece of software but, while it was designed to support multiple users, actually supporting multiple users in practise is not one of its strong points. The last straw for me is where then removed user level security (ULS) from the engine: I suppose I can imagine a simple database situation where all users will have the same privileges (i.e. admin access to all database objects) but IMO that is not supporting multiple users well, as compared with, say, MS SQL Server.

onedaywhen
He-he: even though I'd tried to be careful, I've still been down-voted for speaking out ;-) I'm pretty sure I've included no "wrong information" (I can provide citations if explicitly challenged). Can anyone really disagree with my assertions, "actually supporting multiple users in practise is not one of its strong points" and "[does not support] multiple users well, as compared with, say, MS SQL Server"?
onedaywhen
A: 

It's been done so many times by so many generic software engineers where we've seen a .mdb go corrupt in a multi user situation. If so many experienced specialist Access developers can get it right, as I'm inclined to believe, then we generalists must be doing something wrong and that something must be fairly fundamental yet non-obvious for so many of us to run away from the thing screaming 'Never again!' So if you consider yourself to be a experienced specialist Access developer (or you know how to find one) then go for it. But if you are a generalist or casual user looking for a lightweight back end then I suggest you look elsewhere (SQL Server is good IMO).

onedaywhen
If you're having corruption of an MDB that is used as a Jet data store, then, yes, you are very definitely doing something badly wrong. And I wouldn't know what it might be, to be honest. It's the shared front ends that are the problem in my experience, and that's the one "secret" that professional developers seem to know and the novices seem not to know about.
David-W-Fenton
I've never used an Access front end so it isn't that. It seems these 'corruption' problems (which may in fact only be minor and fixable with a simple 'compact and repair') have non-obvious causes and lead folk to write off the entire product.
onedaywhen
I've never seen those kinds of problems, except with bound editing of memo fields. And there are not-terribly-complicated workarounds for that.
David-W-Fenton
In the last days or so on SO you've hinted at autonumber seed corrupation issues and PK corruption issues. Perhaps we are taking at cross purposes when we simply say "corruption"...?
onedaywhen
Again, an answer is down-voted with no one actually able th challenge my points. David W. Fenton and Tony Toews, who have posted comments to this thread about how they haven't had corruption in years, are undisputed experts in Access and I do not doubt their claims for one minute but I bet they had their share of corruption issues before they learned how to avoid it ;)
onedaywhen
Can I also say that in 10+ years of using Jet-no-Access I've *never* has corruption issues. I used Access+Jet for about a year and had a few corruption issues. Crude conclusions: 1) most (all?) corruption to a Jet MDB is caused by the Access application; 2) corruption is easy to achieve if, like me, you are not an Access power user and you don't know the many tricks to avoid it.
onedaywhen
...corruption, that is. I know many ways of avoiding Access :)
onedaywhen
+1  A: 

If your users can wait twice as long for an application with half of the features they want, then don't use Access.

Jeff O
A: 

Keith stated

"Avoid any bit/bool fields in your tables - Jet has some nasty corruption issues with multiple access to them."

This is the first I've ever heard of bit/bool fields causing corruptions. Memo fields sure but not bit/bool fields. Which are actually called yes/no fields. Could you explain this in more detail?

Tony Toews
See: http://allenbrowne.com/bug-14.html: Outer join queries fail on Yes/No fields: "Simple queries fail with an error such as, "No current record." More complex queries (particularly those with subqueries where this occurs) can crash Access." Perhaps Keith suffered corruption as a result of a crash associated with this nasty bug?
onedaywhen
+1  A: 

If you use a Terminal Server, is work real good. If you look at your performance you can run up to 50 Users at one Access mdb.

Andreas Hoffmann
+1  A: 

I can tell you from painful experience that Jet 3/3.5 was not reliable. I saw it crash frequently under light load and when there were crashes you risked data corruption. It used to be extremely sensitive to any power problems, any client crashing against it (even the UI linked to the mdb), and any LAN problems. More recent versions of Jet might be better but switching to Sql Server is clearly the way to go in my opinion for anything other than trivial data entry with a small number of users. Sql Express is free and you don't really lose anything, especially if you're UI is in .Net, rather than Access.

EDIT: Microsoft doesn't think you should rely on Jet 4 either.

from: http://support.microsoft.com/kb/303528

Microsoft Jet is not intended for use with high-stress server applications, high-concurrency server applications, or 24 hours a day, seven days a week server applications. This includes server applications, such as Web applications, commerce applications, transactional applications, and messaging server applications. For these types of applications, the best solution is to switch to a true client/server-based database system, such as Microsoft Data Engine (MSDE) or Microsoft SQL Server. When you use Microsoft Jet in high-stress applications such as Microsoft Internet Information Server (IIS), you may experience any one of the following problems: Database corruption Stability issues, such as IIS crashing or locking up Sudden failure or persistent failure of the driver to connect to a valid database that requires re-starting the IIS service

bglenn
Jet 3 was released with Access 95, the first Access version to incorporated VBA. By general agreement among Access developers, it was the worst version of Access ever released, and was superceded just a year after its release by the much, much better A97 (which many developers still consider the best Access version ever). A97 shipped Jet 3.5, which was rather buggy in its original release. It took a couple of Jet service packs and a couple of patches to make A97 rock-solid. So, perhaps you didn't use A97 long enough to experience the fully patched version.
David-W-Fenton
Commenting on Access and Jet/ACE as it exists today with references to a version of Jet that was superseded over 10 years ago (Jet 4 shipped with A2000 in June 1999), seems to me to demonstrate that you really don't have anything to add to the conversation.
David-W-Fenton
I specifically pointed out that I wasn't commenting on the current Jet version. That the engine had well known problems with data integrity that I experienced first hand in a mature release (3.5 with all the SPs/patches) that is not that long ago is very relevant to the original post. One data corruption problem is enough to sour you on an engine for life. I've never seen a data corruption problem in Sql Server (caused by the engine). While current Jet/ACE might be as solid as Sql Server, I wouldn't bet on it when you have Sql Server Express/Adp projects as a costless alternative.
bglenn