One of the applications am pretty sure you will encounter one day as a programmer is how to connect MS Access database with multiple users or how to make MS access database accessible over a local area network.
Network applications are pretty cool but the simplest method of connecting your ms access database with your C# application is what I want to explain in this article.
Note: There are lot of issues you will encounter in with network applications and I will love you pay attention to some of the ones I have personally faced and solve.
Issues to note:
- System resources: One major problem of sharing MS access database over LAN is resource conflict. This simply means the computer in which you place your database does it have the resource capacity and capability to serve other devices which will be sharing the database based on it resource?
- Network devices: One other major issue is the devices and equipment you are using. Your network devices (cables, router, switch etc) are they fast in transmitting data? Note: there are different cable eg cat-5, cat-4 all based on speed.
The design of the App
While preparing to develop my first LAN MS access database, two things were clarified.
- I decided to make my c# desktop app to be stand alone app for each system I install it on i.e there is no server app neither client app, the app is one.
- I decided my database should be able to be anywhere on the LAN.
So all I need to get my app working is to locate the database connection string and pass it as a variable to any request on my app. So I designed my c# app with no database but created bunch of functions expecting to kick off whenever they receive connection string.
This might not be the best but this method does not cost much to execute neither require special knowledge to get it done. Everything stated are things easy to get and understand. My next article will be a sample project you will see the code.