Visual Basic for Network Applications

Visual Basic is an ideal tool to use when creating a database application or a front-end to a database server. Included with Visual Basic is support for the Jet engine (used by Microsoft Access) together with ODBC drivers to access "foreign" format databases.
If you are creating a database application that will be used by several users on a network or a standalone application that accesses a shared database file, you need to understand how to provide controls over the way the data is used, shared and updated to prevent problems caused when several users try to update the same table at the same time.
In this chapter, I cover many of the aspects of multiuser programming, including database design that will ensure that databases are shared safely.
One of the classic examples of the problems that you will encounter when programming for multiuser installations on a network is that of multiuser access to a single database. Each user runs a standalone VB application on their computer but the application links to a shared copy of a database file stored on a file server.
By default, the Microsoft Jet engine is clever enough to cope with multiple users and will automatically add record locking to prevent one user updating a record that another user is reading. However, there are a range of techniques to get the most out of this system.
To allow a user to open a...