Close All not Working

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
Jeff Stone
Posts: 44
Joined: Fri Jun 20, 2014 8:41 pm

Close All not Working

Post by Jeff Stone »

Hi Everyone,

I've been away from Harbour and HMG for awhile but decided that I wanted to make sure a VFP application we have could also work in HMG. At one point in our code we call "CLOSE ALL" to close all open tables and an alternate file. While I think the alternate file is closing, none of the tables are closing. I have tried replacing CLOSE ALL with CLOSE DATABASES but the tables all appear to stay open. I am using HMG 3.4.2 32bits on Windows 10 64, fwiw, and compiling the app through IDE. I have stepped through the code with the debugger and can see that the work areas are all open after the CLOSE statements are executed.

Has anyone else ever encountered this issue?

Thanks in advance,

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

Re: Close All not Working

Post by serge_girard »

Hi Jeff,

Are you sure the program reaches 'CLOSE ALL'?
Try to see what is opened just before you reach your CLOSE ALL

Code: Select all

FOR x := 1 TO 55
	SELECT( x )
	IF !EMPTY( ALIAS(x) )
	...
NEXT	
Serge
There's nothing you can do that can't be done...
Jeff Stone
Posts: 44
Joined: Fri Jun 20, 2014 8:41 pm

Re: Close All not Working

Post by Jeff Stone »

Hi Serge,

Thanks for the reply. I am sure that the program is reaching the CLOSE ALL statement. The program is bombing out 3 lines later after we reopen one of the Closed files and try to set a filter.

Regards,

Jeff
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: Close All not Working

Post by Claudio Ricardo »

Hi... Maybe with Harbour function DbCloseAll () or if any db is locked: DbUnLockAll () before DbCloseAll ()
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Close All not Working

Post by mol »

Try to call debugger to find problem. In my opinion it works
User avatar
AUGE_OHR
Posts: 2062
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Close All not Working

Post by AUGE_OHR »

hi,

Network :?:
how "fast" did you re-open after CLOSE ALL :?:

you may have "SMB2-Workstation-Cache" Problem when work in Network and SHARE DBF

---

have a look at
c:\hmg.3.4.4\HARBOUR\contrib\hbxpp\wafuncx.c -> HB_FUNC( WorkSpaceList )
it will give you a Array of ALIAS which are "in use"
have fun
Jimmy
Jeff Stone
Posts: 44
Joined: Fri Jun 20, 2014 8:41 pm

Re: Close All not Working

Post by Jeff Stone »

Thanks to everyone for the suggestions. I was running on a local drive and in the debugger. Close All wasn't working at all but DbCloseAll() worked! So, Claudio is the prize winner. Now I would like to understand why Close All did not work but DbCloseAll() did. Any thoughts?
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: Close All not Working

Post by Claudio Ricardo »

Hi ... The same thing happened to me with "Seek" looking for a single record that matched,
the "Set Softseek Off" did not work and I accepted any similarity as if Softseek were On

Code: Select all

Use Clientes New
Index On Name To Iname
Set SoftSeek Off
Seek cName
If Found ()	Etc. Etc.
In Harbour console app work same as Cli**er 5.2 but in HMG app not work correctly...
but...

Code: Select all

Use Clientes New
Index On Name To Iname
If DbSeek (cName, .F.)	Etc. Etc.
Work fine... Possibly because I use Unicode.
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
Post Reply