1 reply
by thesage
Is this a database application? Are the computers not connected to an Ethernet HUB or are you running token ring.
If it's a database app where the software is accessing records simultaneously in the same Jet, Access, MSDE, etc. database, then your major concern is record locking (actually record page locking, since the above can't do TRUE record locking). If so, and you have a high probability that 2 users will want to change the same record at the same time, then use PESSIMISTIC locking. Once a user has a table page locked in its bookmark, then no one else can access that page in edit mode. This yields problems if some one leaves their desk in the middle of editing a record: no one else can edit it until they unlock the page. OPTIMISTIC locking doesn't lock the page when Edit mode is requested. It locks the page when the program actually writes the update to the table.
To determine which one to use, analyze how your users will need to request the data from the database. The more chance of them needing to edit the same record at the same time, then the greater the need for pessimistic locking.
You could implement your own record level Pessimistic locking by adding a single "LOCKED" field in the tables where collisions are likely. This allows you to configure the database with OPTIMISTIC locking at the page level (preventing whole sets of records from being locked for anything more than a millisecond) and your self-implement PESSIMISTIC regimen at the record level.
DON'T FORGET to clear the LOCKED flag when writing updates to the file. You can handle all of this via the DataEnvironment Designers in VB6 enterprise. I would suggest not using ACCESS for this. Use something MSDE or MySQL. You'll have to learn SQL to get started; however, if you want to get anywhere in database programming, you'll need it.
I suggest you get Sam's "Teach Yourself Database Programming with Visual Basic 6 in 21 Days". It covers both Access and MSDE examples.
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending