Home > database >  About: access database cannot update has been locked
About: access database cannot update has been locked

Time:10-14

Recently made a case, not complicated,
In VS2012 environment, create a VB.net window procedure, read the data from external hardware, and then write Access database,

Follow-up is the conventional add and delete operations

XXX
Database only one user, it is A VB,.net created program, this program following abbreviation for A program,

This A program, which is linear to the operation of the database, after normal work, only one thread operation Access database

In this case, or in the access database cannot update has been locked,

XXX
Google, found that many people have this situation, and summarizes the reasons for

1) multiple user concurrent access to


2) connect the Access database "cannot update, currently locked" problem

When I was in the use of executeBatch to this problem, and also shut down the Connection and Statement in exception handling object.

Through inspection found that the reason is that an exception when no rollback.

In the catch block of code to join con. The rollback ().

3) (https://www.thinbug.com/q/38385621)
I tried did not prevent the wrong things:

Close the connection after each insert, (in addition to not solve the problem, leading to the rapid increase of the execution time,)

Detect the error and try to restore close all connections,

CursorTypes each permutation,

Replace the Execute SQL ADODB you Update method (INSERT INTO... ),

Converts Access 2003 database to Access 2013 and Jet switch for Jet Ace 12, 4.0

A front end to a database, (database usually resides on a network share, there is no front end)

Remove the database to C:, (I have already read the database of long path will produce error,)

Change the client Access Settings to perform based on the lock and lock all change to no lock to have editor,

Editor: before recovery delay is added in the fault trap,


4) database is too large, lead to delay

https://blog.csdn.net/qq_22855325/article/details/76087138


5) Microsoft's bug
https://blog.csdn.net/iteye_18932/article/details/82433930

* * * * * * * * * * * * * * * * * * * *
I use to Access the Access data application, is a more conventional online
The code is as follows:
 Sub New () 'the default constructor of a class in the VB.net 

'need to access the database an interface or tools, the industry call engine, the following descriptions, engine is divided into two kinds: the ACE engine and JET engine

'JET engine can only access off97 -- -- -- -- -- office2003 link example: string string connStr="Provider=Microsoft. JET. The OleDb. 4.0. The data source=1. MDB ";

'ACE engine not only can access an above the database version, and can also visit the office version of the JET engine can access,

'link string examples: the ConnectionString=@ "Provider=Microsoft. ACE. The OLEDB. 12.0; The Data Source=1. Accdb ";

'ConnStr="Provider=Microsoft. Jet. The OLEDB. 4.0; Data Source="& amp; Application. StartupPath & amp; "\ Test. MDB. Persist Security Info=False "

'the original database connection string
'm_Database_connectionString="Provider=Microsoft. ACE. The OLEDB. 12.0; Data Source="& amp; Application. StartupPath & amp; "\ Test. Accdb; Persist Security Info=False "
'FBMES system database connection string
M_Database_connectionString="Provider=Microsoft. ACE. The OLEDB. 12.0. Data Source=D: \ \ FBMES FBMES related important documents accdb; Persist Security Info=True; The Jet OLEDB: Database Password=123456
"
End Sub


A full set of code below
(to CSDN audit)


CodePudding user response:

Link: https://pan.baidu.com/s/1D-8Q6Xx4AQehQCCTPVhOYg Numbers: 2 ndu copy after this paragraph open baidu cloud mobile phone App, operation more convenient oh
Or use baidu network backup this don't need to review

It is to access the database source code

CodePudding user response:

Going to change a train of thought, the library, need not online by VS own add data

CodePudding user response:

Q: is not registered on the local computer "Microsoft. ACE. The oledb. 12.0" solutions provider
A1: there are comments, according to a 32-bit program calls 64 Access will appear this problem,

In VS the solution of the properties of the modified inside, the target CPU switch from AnyCpu X64, found or an error that is not the problem

https://blog.csdn.net/YYZZHC999/article/details/79367114
A2: download AccessDatabaseEngine this trifle
https://www.microsoft.com/en-us/download/details.aspx? Id=54920


CodePudding user response:

The record:
Through keywords AccessDatabaseEngine I get two files, one is the suffix marked 64, without a mark

Because our system is WIN 10 6, my Office is 2016-64, so I take it for granted that I should pack a suffix is a 64 - bit AccessDatabaseEngine file, display is a dozen face,

Really want to install without 64 suffix of the situation, feeling good pit

PS: AccessDatabaseEngine each version download link

AccessDatabaseEngine2016
https://www.microsoft.com/en-us/download/details.aspx? Id=54920

AccessDatabaseEngine2010
https://www.microsoft.com/en-us/download/details.aspx? Id=13255

AccessDatabaseEngine2007
https://www.microsoft.com/en-us/download/details.aspx? Id=23734


* * * * * * * * * * * * * * *
Author: https://blog.csdn.net/myruo/article/details/87932800

CodePudding user response:

Access to data Access scheme one:
https://blog.csdn.net/WKX18330698534/article/details/51175030
The scheme has no use ODBC, he is in VS a links to Access database, all don't write one line of code, you can Access database window display of VBNET program of things inside,

  • Related