PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → HFSQL error: Unable to lock zone of <File> file.
HFSQL error: Unable to lock zone of <File> file.
Débuté par Arekusei Timakobu, 20 sep. 2017 09:26 - 6 réponses
Posté le 20 septembre 2017 - 09:26
I get this error when I try to only modify record of some file. Record is added or deleted w/o any problem. Anyone knows how to fix?
P.S.File is re-indexed etc.
Posté le 20 septembre 2017 - 09:50
Hi,

A bit more information is required I'm afraid.

Can you describe in more detail about how you are currently attempting this - code samples always help...

e.g. Are you trying to Modify straight after adding the record?
Posté le 20 septembre 2017 - 09:55
After some analysis the next thing was found out: the update form is called from internal window with Independent HFSQL context. When this checkbox is checked off the error dissapeared and record is modified. Yes, this is a solution but the reason of this behavour is still unknown because in other pair - TABLE on other internal window (with independent HFSQL context) and update form - all works fine.
Posté le 20 septembre 2017 - 10:03
Quote
DarrenF
A bit more information is required I'm afraid

The common approach is TABLE control on internal window (with checkbox "Independent HFSQL context"), three buttons (Insert,Change, Delete) and update window. There is some CRUD class that manages the CRUD operations. What is done:
1. Click Insert - record added.
2. Click Change, change something, click OK... then some pause and the error appeares in error window (HOnError with hErrLock is used).
3. Click Delete - record deleted,

After consideration of source code I noticed that the error happends on HModify statement, i.e. it is catched by HOnError procedure. The simple code is:
IF NOT HModify(File) THEN ... END
The CRUD functionality is used in many places of the same software (with other files) and no errors occurred. The error is only for single file that is not some special thing.
Posté le 20 septembre 2017 - 10:47
Hi,

I am afraid it is difficult for somebody to help if he doesn't see your Change code.
Post the code AND your WX version AND Database (Classic or C/S)

Steven Sitas
www.alpha360.biz
Posté le 20 septembre 2017 - 13:20
Hi

from the very little you are telling us, it looks like you are doing a hmodify without reading the record first.

Best regards
Posté le 22 septembre 2017 - 11:26
Hi Arekusi,

It is not possible to update a record from a different context.
So you should really be worried why it is working in other cases and if it is not updating another record that happens to be in memory in that context.

Kind regards,
Piet