Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Expertise: Beginner
Aug 8, 1997



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Avoid Update Errors In Access Databases

Avoid "Couldn't update; currently locked by user 'name' on machine 'machine' " error in VB4 when two or more applications access the same MS Access database table.

For the given table, a primary or any nonunique key is defined. The two applications may have opened the database table as any one of the record-set types such as dynaset or table.

If one of the applications is idle (just opened the record set and no edit/updation taking place) and the other application tries to update or add a record to the table, then the Error Code: 3260 ("Couldn't update; currently locked by user 'name' on machine 'machine' ") is displayed.

To avoid this, after the record set is opened (in case of a table record set, if index is being set, then after the Index property is set), include this statement:

DBEngine.Idle (dbFreeLocks)

VB4 releases the table locks and now the other application will be able to update the database table. For example:

Dim DB as Database, TB as Recordset

Set Db = WorkSpaces(0).OpenDatabase_
Set TB = Db.OpenRecordset("Customer_
Tb.Index = "PrimaryKey"

DBEngine.Idle (dbFreelocks)

Rajesh Patil
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date