"Workarea not in use" Error

Moderator: Rathinagiri

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

"Workarea not in use" Error

Post by asharpham » 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

User avatar
esgici
Posts: 4464
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 344 times
Been thanked: 103 times
Contact:

Post by esgici » Thu Mar 29, 2018 8:28 am

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: 576
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 15 times
Been thanked: 111 times

Post by dragancesu » Thu Mar 29, 2018 8:39 am

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
Has thanked: 14 times

Post by asharpham » Thu Mar 29, 2018 10:25 am

I did this:

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

but got the same result.

edk
Posts: 361
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 102 times
Been thanked: 262 times

Post by edk » Thu Mar 29, 2018 10:35 am

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: 314
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF
Has thanked: 62 times
Been thanked: 44 times

Post by Anand » Thu Mar 29, 2018 11:08 am

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
Image

User avatar
serge_girard
Posts: 2140
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 449 times
Been thanked: 102 times
Contact:

Post by serge_girard » Thu Mar 29, 2018 1:02 pm

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

User avatar
mol
Posts: 3062
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 176 times
Been thanked: 96 times
Contact:

Post by mol » Thu Mar 29, 2018 5:50 pm

Dbf file names are not delimited to 8 characters now

User avatar
serge_girard
Posts: 2140
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 449 times
Been thanked: 102 times
Contact:

Post by serge_girard » Thu Mar 29, 2018 8:22 pm

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

Serge

User avatar
mol
Posts: 3062
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 176 times
Been thanked: 96 times
Contact:

Post by mol » Thu Mar 29, 2018 8:49 pm

Fieldnames are delimited to 10 chars :-(

Post Reply