Hi,
a customer reported me the following error:
"Error description: Error DBCMD/2001 Workarea not in use: DBGOTO "
at the line "GO SCOST" from the function as follows.
This is a simply function that open the dbf file "cFile" and read the record "scost". I made some tests but this error never appairs.
Is there someone that can give me an idea about the reason of this problem ?
Thanks in advance.
----
function ReadLibroCassa(cFile,scost)
store "" to lb01,lb02,lb03,lb04,lb05,lb06,lb06,lb07,lb08,lb09,lb10,lb11,lb12,lb13,lb14,lb15,lb16
use &cFile alias pippo
go scost
lica1 := pippo->lb01
lica2 := pippo->lb02
lica3 := pippo->lb03
lica4 := pippo->lb04
lica5 := pippo->lb05
lica6 := pippo->lb06
lica7 := pippo->lb07
lica8 := pippo->lb08
lica9 := pippo->lb09
lica10:= pippo->lb10
lica11:= pippo->lb11
lica12:= pippo->lb12
lica13:= pippo->lb13
lica14:= pippo->lb14
lica15:= pippo->lb15
lica16:= pippo->lb16
lica17:= pippo->lb17
lica18:= pippo->lb18
lica19:= pippo->lb19
lica20:= pippo->lb20
lica21:= pippo->lb21
lica22:= pippo->lb22
lica23:= pippo->lb23
close pippo
return
Error DBCMD/2001 Workarea not in use: DBGOTO
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
Error DBCMD/2001 Workarea not in use: DBGOTO
Best Regards,
Marco Turco
SOFTWARE XP LLP
Marco Turco
SOFTWARE XP LLP
Hello Marco,
is the go command in your original code immediately after the use command – then I have no idea.
Otherwise:
I always use dbselect() before a goto command to be sure that the goto is
really addressing the right dbf-file.
Select mydbf
Goto nRecno
Sometimes you have commands like
oWnd:bGotFocus = { || dbSelectArea( "xxx.dbf" )} in your code
and this changes the work area where you don’t expect .
Maybe there is a message box or a user sets the focus to another
object and the work area is automatically changed.
Regards,
Otto
is the go command in your original code immediately after the use command – then I have no idea.
Otherwise:
I always use dbselect() before a goto command to be sure that the goto is
really addressing the right dbf-file.
Select mydbf
Goto nRecno
Sometimes you have commands like
oWnd:bGotFocus = { || dbSelectArea( "xxx.dbf" )} in your code
and this changes the work area where you don’t expect .
Maybe there is a message box or a user sets the focus to another
object and the work area is automatically changed.
Regards,
Otto
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
Re: Error DBCMD/2001 Workarea not in use: DBGOTO
Marco,
it seems your dbf file is already open.
If so, you should open your dbf as shared.
Or you close it before coding 'use &cFile ..'
You may prove my assumption by asking for the value of neterr() after the use-command.
I also would recommend you to say 'pippo->( dbGoto( scost ) )'
and asure that scost is really of type numeric.
hth
Detlef
it seems your dbf file is already open.
you are writing into fields lb01, lb02, ...store "" to lb01,lb02,lb03,lb04,lb05,lb06,lb06,lb07,lb08,lb09,lb10,lb11,lb12,lb13,lb14,lb15,lb16
If so, you should open your dbf as shared.
Or you close it before coding 'use &cFile ..'
You may prove my assumption by asking for the value of neterr() after the use-command.
I also would recommend you to say 'pippo->( dbGoto( scost ) )'
and asure that scost is really of type numeric.
hth
Detlef