Avoid Update Errors In Access Databases

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:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several