Stephen K
Stephen K

Reputation: 737

Using C# to modify Access database. Is it safe?

At my job, we use Access databases still.

My boss told me that he created forms to edit records in tables because if multiple people have the database open, it can cause problems when saving. I don't know the validity of this, but it's besides the point.

My question:

If I make an application in C# or some other programming language to update records, outside of me programming it incorrectly, is there anything that can go wrong to negatively impact the database? Will the presence of the .laccdb file cause any issues to arise?

Upvotes: 0

Views: 197

Answers (1)

Gord Thompson
Gord Thompson

Reputation: 123399

is there anything that can go wrong to negatively impact the database?

ACE/Jet (Access) databases are shared-file databases, meaning that each client uses its own copy of the database engine to update the database file. For this reason, network interruptions are more likely to cause corruption of a shared-file database than they would be for a client-server database.

If your network connections are reliable then the risk of database corruption caused by network failures is quite low. If your network clients are prone to dropped connections and other glitches (weak/intermittent WiFi connections would be one example) then a shared-file database might not be the best choice.

Will the presence of the .laccdb file cause any issues to arise?

No, because the .laccdb lock file is essential for managing multi-user access to the database. In fact it's the absence of an .laccdb file (caused by improper folder permissions on the network folder) that can cause problems.

My boss told me that ... if multiple people have the database open, it can cause problems when saving.

Your boss was probably referring to the practice of multiple concurrent users directly opening the same copy of a shared .accdb file in Access itself. That can cause problems, which is why a multi-user Access database must be split between:

  • a common back-end file containing just the data tables and residing in a shared folder, and

  • individual copies of the front-end file (containing Queries, Forms, Reports), one for for each user, residing on their own local hard drive. The individual front-end files use linked tables to access the data tables in the shared back-end file.

Upvotes: 1

Related Questions