Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 9 Monaten
Letzter Beitrag:
vor 9 Monaten
Beteiligte Autoren:
Arekusei Timakobu, Piet van Zanten, Fabrice Harari, Steven Sitas, DarrenF

HFSQL error: Unable to lock zone of file.

Startbeitrag von Arekusei Timakobu am 20.09.2017 07: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.



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?

von DarrenF - am 20.09.2017 07:50
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.

von Arekusei Timakobu - am 20.09.2017 07:55
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

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.

von Arekusei Timakobu - am 20.09.2017 08:03

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

von Steven Sitas - am 20.09.2017 08:47

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

Best regards

von Fabrice Harari - am 20.09.2017 11:20
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,

von Piet van Zanten - am 22.09.2017 09:26
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.