Re: Could not update; currently locked error



Hello Bob,

Thank you very much for your reply.

Definitely permissions are not the problem because I see the .ldb file being
created, modified and deleted.

If I understand right if Jet is single-threaded I can synchronize my threads
in C++ without any loss in performance because it is synchronized somewhere
between ADO and Jet anyway.

I am not quite understand how the switching of ADODB from apartment-threaded
to free-threaded may help me to prevent the lock error. Could you explain me
please?

I wonder if there any way to tell Jet to wait and retry again if a record is
locked?

Unfortunately I have to leave and cannot answer you right away.

Thank you very much in advance,
Andriy

"Bob Barrows [MVP]" wrote:

Jet is single-threaded, but, if permissions are not the problem, you
should be seeing the .ldb file being created, modified and deleted while
your application is working. Do you? If not, then permissions is the
problem.

ADODB is apartment-threaded by default. You might try switching it to
free-threaded by using the makfre15.bat file in the ...\program
files\common files\system\ado folder. Maybe that will help too.

Otherwise, you will need to catch and handle the error.

Andriy wrote:
Hello Bob,

Thank you very much for your reply.

I don't think this is a permission problem. My test application runs
2 threads which are waiting on the same event. When I pulse the
event, each thread opens its own connection to the same db file and
executes update statement on its own record in the same test table.
As far as I understand both threads run with the same user
permissions because I do not specify any security attributes for
threads. Nevertheless one of the threads succeeds, and another one
fails. The same thing happens when the threads execute insert
statements.

Do you have any idea what connection properties should I look for?
Should I look for ADO properties or Jet OLEDB provider properties?

Thank you very much in advance,
Andriy

"Bob Barrows [MVP]" wrote:

Andriy wrote:
Hello,

I run a C++ test program that updates records in MS Access database
(mdb file) from different threads. I use ADO to access the database.
As far as I understand the underlying provider is MS Jet OLEDB. I
get the following error: Code = 80004005
Code meaning = Unspecified error
Source = Microsoft JET Database Engine
Description = Could not update; currently locked.

I do not understand why I get this error even when I insert records
or update different records. Is there any way to tell ADO/Jet not to
produce error but wait till records are unlocked?

Assuming the database is not marked Read-Only or resides on a cd,
this is most likely a permissions problem. In order for multi-user
activity to be supported, all users of the database file need to be
able to create, modify and delete a locking file (.ldb) in the
folder containing the database. Users need Modify permissions for
that folder, not just the database file.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



.



Relevant Pages

  • Re: Unable To Re-link Tables
    ... The TMP%#MAU@ table is a temporary table that Jet creates to hold meta data ... as well as the computer where the back-end database is located. ... > so the problem appears to be somehow related to permissions. ... > tables and queries, but that still doesn't grant permissions for this ...
    (microsoft.public.access.security)
  • Re: Access Database - Locked out from Design
    ... What happens if the 'owner' of the ldb file tries to delete it? ... permissions issue - maybe your permissions are set up such that only the ... 1- User "A" opens the database, and Access creates the .ldb file in the ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Access Database - Locked out from Design
    ... It varies as to who is holding the ldb file open --- I think it is whoever ... accesses the database first. ... remotely using remote desktop connection via a VPN. ... permissions issue - maybe your permissions are set up such that only ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Could not update; currently locked error
    ... Jet is single-threaded, but, if permissions are not the problem, you ... Should I look for ADO properties or Jet OLEDB provider properties? ... I use ADO to access the database. ... Please reply to the newsgroup. ...
    (microsoft.public.data.ado)
  • Re: Could not update; currently locked error
    ... Just out of curiosity...did you double check the level of locking that you ... Definitely permissions are not the problem because I see the .ldb file being ... If I understand right if Jet is single-threaded I can synchronize my threads ... I run a C++ test program that updates records in MS Access database ...
    (microsoft.public.data.ado)