Why do I receive an error when trying to insert records to an Access database using two parallel running instances of MATLAB?

1 visualización (últimos 30 días)
I am getting the following error when trying to insert records to an Access database using two parallel running instances of MATLAB:
??? Java exception occurred:
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Could not read; currently locked by user 'admin' on machine 'XYZ'.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLExecute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(Unknown Source)
Error in ==> database.fastinsert at 184
StatementObject.execute;

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 2 de En. de 2020
Editada: MathWorks Support Team el 26 de Ag. de 2020
Using FASTINSERT to insert records to the same table in the same Microsoft Access database using two parallel running instances of MATLAB should work.
The most likely cause for this error is that the database might be open exclusively for editing by another user:
Another possible cause is the use of "referential integrity": if you set referential integrity while using transactions, it could throw the mentioned error. An SQL Server database, for example, does not have this problem, but MS Access does. Removing the "enforce referential integrity" feature could solve this problem.
The Database Toolbox does not support explicitly setting the locking mechanism to be used. More information about lock types can be found here:
If problems persist, the Tracing feature of the ODBC console can be used to try to find the cause of the problem. Another possibility is to implement the database access manually through ADODB (actxserver, Windows only).

Más respuestas (0)

Categorías

Más información sobre Use COM Objects in MATLAB en Help Center y File Exchange.

Productos


Versión

R2007b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by