Error DBFNTX/1022 Lock required

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

carlazza
Posts: 22
Joined: Sun Nov 07, 2021 1:09 pm
DBs Used: DBF
Location: Italia

Error DBFNTX/1022 Lock required

Post by carlazza »

Hello everybody

I have 2 browse that pointing to the same DBF in this way

USE FCASSA new SHARED Alias FU
set index to fcassastagx1, fcassadatx1
set filter to AllTrim(FU->TipoMov) = "U"
FU->(DbGoTop())

USE FCASSA new SHARED Alias FE
set index to fcassastagx1, fcassadatx1
set filter to AllTrim(FE->TipoMov) = "E"
FE->(DbGoTop())

@ 60, 20 BROWSE Br_cassain ;
OF CDL2A ;
WIDTH 610 ;
HEIGHT 700 ;
FONT "calibri" ;
SIZE 11 ;
BOLD ;
BACKCOLOR VERDE ;
FONTCOLOR WHITE ;
HEADERS { "DESCRIZIONE", "DATA", "IMPORTO" } ;
WIDTHS { 400, 90, 100 } ;
WORKAREA FE ;
FIELDS { "descr", "datamov", "importo" } ;
ON DBLCLICK EDIT("E");
ON CHANGE LOADDATA("E")


@ 60, 1250 BROWSE Br_cassaout ;
OF CDL2A ;
WIDTH 610 ;
HEIGHT 700 ;
FONT "calibri" ;
SIZE 11 ;
BOLD ;
BACKCOLOR ROSSO ;
FONTCOLOR WHITE ;
HEADERS { "DESCRIZIONE", "DATA", "IMPORTO" } ;
WIDTHS { 400, 90, 100 } ;
WORKAREA FU ;
FIELDS { "descr", "datamov", "importo" } ;
ON DBLCLICK EDIT("U");
ON CHANGE LOADDATA("U")

When I try to update one of them, "Error DBFNTX/1010 Lock required" occurred

How can I solve the problem?

Thanls
Carlo
Last edited by carlazza on Sat Mar 12, 2022 8:33 am, edited 1 time in total.
User avatar
serge_girard
Posts: 3420
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Error DBFNTX/1010 Lock required

Post by serge_girard »

Carlo TRY:

USE FCASSA new EXCL Alias FU (or the other)

Serge
There's nothing you can do that can't be done...
carlazza
Posts: 22
Joined: Sun Nov 07, 2021 1:09 pm
DBs Used: DBF
Location: Italia

Re: Error DBFNTX/1010 Lock required

Post by carlazza »

Hi Serge

sorry but doesn't work

"workarea not in use" is the new error
User avatar
serge_girard
Posts: 3420
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Error DBFNTX/1022 Lock required

Post by serge_girard »

I once experienced the same. It is probably the ALIAS name.
I will try to find how I got it solved backed then...
Serge
There's nothing you can do that can't be done...
carlazza
Posts: 22
Joined: Sun Nov 07, 2021 1:09 pm
DBs Used: DBF
Location: Italia

Re: Error DBFNTX/1022 Lock required

Post by carlazza »

Thanks
User avatar
dragancesu
Posts: 931
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: Error DBFNTX/1022 Lock required

Post by dragancesu »

USE FCASSA new SHARED Alias FU
set index to fcassastagx1, fcassadatx1
set filter to AllTrim(FU->TipoMov) = "U"
FU->(DbGoTop())

USE FCASSA new SHARED Alias FE
set index to fcassastagx1, fcassadatx1
set filter to AllTrim(FE->TipoMov) = "E"
FE->(DbGoTop())
You use one dbf twice, i see what is different but why? If two or more program use one dbf than is SHARED but when REPLACE/UPDATE must be used LOCK()/UNLOCK(). We don't see your code for EDIT/UPDATE
carlazza
Posts: 22
Joined: Sun Nov 07, 2021 1:09 pm
DBs Used: DBF
Location: Italia

Re: Error DBFNTX/1022 Lock required

Post by carlazza »

dragancesu wrote: Sat Mar 12, 2022 10:16 am
USE FCASSA new SHARED Alias FU
set index to fcassastagx1, fcassadatx1
set filter to AllTrim(FU->TipoMov) = "U"
FU->(DbGoTop())

USE FCASSA new SHARED Alias FE
set index to fcassastagx1, fcassadatx1
set filter to AllTrim(FE->TipoMov) = "E"
FE->(DbGoTop())
You use one dbf twice, i see what is different but why? If two or more program use one dbf than is SHARED but when REPLACE/UPDATE must be used LOCK()/UNLOCK(). We don't see your code for EDIT/UPDATE
IF err==0
IF from == "NEW"
FU->(dbAppend())
ELSE
FU->(dbGoTo ( CDL2A.Br_cassaout.Value ))
ENDIF

FU->FIELD1 := XXX
FU->FIELD2 := XXX
FU->FIELD3 := XXX
FU->FIELD4 := XXX

CDL2A.Br_cassaout.Refresh
dbCommitAll()

ENDIF

RETURN
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

Re: Error DBFNTX/1022 Lock required

Post by SALINETAS24 »

Has probado con LOCK..???
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
carlazza
Posts: 22
Joined: Sun Nov 07, 2021 1:09 pm
DBs Used: DBF
Location: Italia

Re: Error DBFNTX/1022 Lock required

Post by carlazza »

I wrote this post just to ask how to fix the lock problem
User avatar
dragancesu
Posts: 931
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: Error DBFNTX/1022 Lock required

Post by dragancesu »

Post Reply