Close All not Working
Moderator: Rathinagiri
-
- Posts: 44
- Joined: Fri Jun 20, 2014 8:41 pm
Close All not Working
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
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
- 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
Hi Jeff,
Are you sure the program reaches 'CLOSE ALL'?
Try to see what is opened just before you reach your CLOSE ALL
Serge
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
There's nothing you can do that can't be done...
-
- Posts: 44
- Joined: Fri Jun 20, 2014 8:41 pm
Re: Close All not Working
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
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
- 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
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
WhatsApp / Telegram: +54 911-63016162
Re: Close All not Working
Try to call debugger to find problem. In my opinion it works
- 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
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"
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
Jimmy
-
- Posts: 44
- Joined: Fri Jun 20, 2014 8:41 pm
Re: Close All not Working
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?
- 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
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
In Harbour console app work same as Cli**er 5.2 but in HMG app not work correctly...
but...
Work fine... Possibly because I use Unicode.
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.
but...
Code: Select all
Use Clientes New
Index On Name To Iname
If DbSeek (cName, .F.) Etc. Etc.
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
WhatsApp / Telegram: +54 911-63016162