"Workarea not in use" Error

Moderator: Rathinagiri

asharpham
Posts: 55
Joined: Sat Mar 24, 2018 2:48 pm
DBs Used: DBF

"Workarea not in use" Error

Post by asharpham »

I have these 2 lines of code:
USE Library NEW
dbGoBottom()
which compiles fine but gives me this runtime error:
"Workarea not in use: DBGOBOTTOM".

I've looked at samples and right through the documentation but can't see why I'm gettiong this error. I would have thought opening the database and then navigating it should work.

Regards,
Alan
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: "Workarea not in use" Error

Post by esgici »

asharpham wrote: Thu Mar 29, 2018 8:01 am I have these 2 lines of code:
USE Library NEW
dbGoBottom()
which compiles fine but gives me this runtime error:
"Workarea not in use: DBGOBOTTOM".

I've looked at samples and right through the documentation but can't see why I'm gettiong this error. I would have thought opening the database and then navigating it should work.

Regards,
Alan
Hi Alan

Probably your file "Library" didn't open.

You can use USED() function just after USE command and before any database command / function to test database file is successfully open; and / or FILE() function before USE command to check existence of yor file.

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
User avatar
dragancesu
Posts: 920
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: "Workarea not in use" Error

Post by dragancesu »

Command USE TABLE NEW
should only appear once in the program
If it's already open it can not again (maybe it can clipper, it can not hmg)

If is possible save problematic program in the zip and add it to the attachment,
it will be easier for everyone who wants to help
asharpham
Posts: 55
Joined: Sat Mar 24, 2018 2:48 pm
DBs Used: DBF

Re: "Workarea not in use" Error

Post by asharpham »

I did this:

IF USED()
dbGoBottom()
ELSE
USE Library NEW
dbGoBottom()
ENDIF

but got the same result.
edk
Posts: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: "Workarea not in use" Error

Post by edk »

Try to ask for an open alias before dbGoBottom ().

Code: Select all

USE Library NEW
MsgBox( Alias(), 'Active Alias' )
dbGoBottom()
What is the active alias?
User avatar
Anand
Posts: 595
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF

Re: "Workarea not in use" Error

Post by Anand »

asharpham wrote: Thu Mar 29, 2018 10:25 am I did this:

IF USED()
dbGoBottom()
ELSE
USE Library NEW
dbGoBottom()
ENDIF

but got the same result.
Hi asharpham

The correct code is

Code: Select all

USE Library NEW
IF USED()
     dbGoBottom()
ENDIF
Regards,

Anand
Regards,

Anand

Image
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: "Workarea not in use" Error

Post by serge_girard »

Hi Alan,

I have no problems with this:

Code: Select all

USE Library NEW
dbGoBottom()
If this gives error with your file, I think your file is corrupted (long filed name?)
Try to dbcreate it again with :

Code: Select all

// ferase('library.dbf')

 aSTRUCT := { {"TRACKNUM","N",4,0 }, ;
 {"ALBUM_NO","C",6,0}, ;
 {"ALBUM_TITL","C",40,0}, ;
 {"TITLE","C",33,0}, ;
 {"ARTIST","C",40,0}, ;
 {"ART_NO","N",4,0}, ;
 {"TRACK","N",2,0}, ;
 {"DUR","C",5,0}, ;
 {"YR","C",2,0}, ;
 {"FILENAME","C",8,0} }

dbCreate("LIBRARY",aSTRUCT)
USE Library NEW
msginfo(alias())

dbGoBottom()
Serge
There's nothing you can do that can't be done...
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: "Workarea not in use" Error

Post by mol »

Dbf file names are not delimited to 8 characters now
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: "Workarea not in use" Error

Post by serge_girard »

No, but fieldnames? I think:problem when reading...

Serge
There's nothing you can do that can't be done...
Post Reply