VB4 and Access Locking Errors. 
Author Message
 VB4 and Access Locking Errors.

I have developed an application in VB4.0 with an Access 2.0 database.  The
updates/writes are done through SQL statements using the EXECUTE method.
Data retrieval is done using the OPENRECORDSET method and specifying the
DbOpenSnapshot option.  From reading the help, I assumed that this would
bypass any locking problems that are inherent in Access.  However, I am
still receiving locking violation errors: "Cannot update, currently locked
by ...".

Where am I going wrong?  Have I overlooked something by using the EXECUTE
and OPENRECORDSET/DbOpenSnapshot methods?  Any help would be greatly
appreciated.



Mon, 22 Feb 1999 03:00:00 GMT
 VB4 and Access Locking Errors.

Quote:

> I have developed an application in VB4.0 with an Access 2.0 database.  The
> updates/writes are done through SQL statements using the EXECUTE method.
> Data retrieval is done using the OPENRECORDSET method and specifying the
> DbOpenSnapshot option.  From reading the help, I assumed that this would
> bypass any locking problems that are inherent in Access.  However, I am
> still receiving locking violation errors: "Cannot update, currently locked
> by ...".

> Where am I going wrong?  Have I overlooked something by using the EXECUTE
> and OPENRECORDSET/DbOpenSnapshot methods?  Any help would be greatly
> appreciated.

Chris,
To the best of my knowledge Snapshots are not updateable. Choose
the dbOpenDynaset option.

You may still have a problem. Perhaps should check out whether the
Access 2 Jet syntax permits this version of the open recordset syntax.

Cheers.                       ...edn



Tue, 23 Feb 1999 03:00:00 GMT
 VB4 and Access Locking Errors.

Quote:

> I have developed an application in VB4.0 with an Access 2.0 database.  The
> updates/writes are done through SQL statements using the EXECUTE method.
> Data retrieval is done using the OPENRECORDSET method and specifying the
> DbOpenSnapshot option.  From reading the help, I assumed that this would
> bypass any locking problems that are inherent in Access.  However, I am
> still receiving locking violation errors: "Cannot update, currently locked
> by ...".

You are still using Jet.  I am having similar problems with locks.  Note
that the default locking scheme in VB4 is pessimistic.  You'll have to
explicitly change it to optimistic.  Also, some well placed
DBEngine.Idle dbFreelocks will help.  After all this, I still have
problems as you describe.

I found the following in the VB4 help file under the AddNew Method:

"When you use AddNew and the Microsoft Jet database engine has to create
a new 2K page to hold the current record, page locking is pessimistic.
If the new record fits in an existing page, page locking is optimistic."

I have found that adding a DBEngine.Idle dbFreeLocks after .addnew
helps, but does not eliminate the problem.  There are some articles in
the kb (sorry, I don't recall the numbers) that Microsoft recommended
reading.  I added the suggestions but still have the locking problems.



Tue, 23 Feb 1999 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Custom Locking code for Database Locked in VB4 with Access 2.0 - HELPPPPPP

2. VB4.0 Access 2.0 multiuser locking

3. Locked records in Access/VB4.0 16 bit

4. Locks and Access with VB4

5. Please Help: VB4 Locks up during database access

6. Locking A Single Record - VB4 Prof and an Access Database

7. Locked records in Access/VB4.0 16 bit

8. locking big trouble with VB4 (524 Error)

9. Access denied error using VB4.0 professional

10. Error 3110 with QueryDefs in Access 1.10 with VB4

11. SQL Error 3085 - Using Access VBA Functions in VB4

12. Error 3085 with Access 2.0/VB4(16), using calculated columns


 
Powered by phpBB® Forum Software