Avoid Update Errors In Access Databases

Avoid “Couldn’t update; currently locked by user ‘name’ onmachine ‘machine’ ” error in VB4 when two or more applicationsaccess 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 anyone of the record-set types such as dynaset or table.

If one of the applications is idle (just opened the record setand no edit/updation taking place) and the other application triesto 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 tablerecord set, if index is being set, then after the Index propertyis set), include this statement:

 DBEngine.Idle (dbFreeLocks)

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

 Dim DB as Database, TB as RecordsetSet Db = WorkSpaces(0).OpenDatabase_        ("Test.mdb")Set TB = Db.OpenRecordset("Customer_        Master",dbOpenTable)Tb.Index = "PrimaryKey"DBEngine.Idle (dbFreelocks)
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

The Latest

microsoft careers

Top Careers at Microsoft

Microsoft has gained its position as one of the top companies in the world, and Microsoft careers are flourishing. This multinational company is efficiently developing popular software and computers with other consumer electronics. It is a dream come true for so many people to acquire a high paid, high-prestige job

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS