I have a fairly large VB5 application and I have tried to implement my own
locking scheme using a lock table. This works fine most of the time but
occasionally I am getting one or two unexpected errors when trying to update
records.
My record sizes are all pretty small (less than 2K).
I have some questions:
1. It looks like I should be setting the LOCKEDITS parameter to false when I am
opening my dynasets, i.e. it defaults to pessimistic locking. Is my assumption
correct? If I am using lockedits=false, does Jet still lock pages when new
records are being inserted - ie could I still get a lock error when 2
workstations try to do an Addnew at the same time?
2. I use BeginTrans..CommitTrans statements in various places in the app,
mainly on sensitive areas (writing to one table usually), to ensure that I can
abort the whole update operation if an error occurs in the middle. I have seen
somewhere that using transactions will cause pessimistic locking to come into
force. Is this true? If so, I will not be able to use transactions with my
optimistic locking scheme.
3. Would using ADO make things easier? How much work is involved in changing
over to ADO from DAO? Can it be done in VB5 or would I need to convert the
whole project to VB6?
Any advice appreciated!
Andy Rigby