DBF close problem
Moderator: Rathinagiri
DBF close problem
Hi you all,
I have a strange problem. There are open DBF files that sometimes close themselves. I cannot give an example code, because it happens randomly in different functions. In that case I get an error notification I log the open files, but it says there are no open DBF files.
Have anyone experienced something like this before? Any tips on how to handle it?
I have a strange problem. There are open DBF files that sometimes close themselves. I cannot give an example code, because it happens randomly in different functions. In that case I get an error notification I log the open files, but it says there are no open DBF files.
Have anyone experienced something like this before? Any tips on how to handle it?
- salamandra
- Posts: 311
- Joined: Thu Jul 31, 2008 8:33 pm
- DBs Used: DBF, MySQL, SQL
- Location: Brazil
Re: DBF close problem
Hi mlnr,
Can you post your code and the errorlog file ?? maybe we can help you.
Best regards,
Salamandra, Brazil
If This problem it´s related always to the same DBF files probably you have an error in your program.mlnr wrote: ↑Mon Feb 01, 2021 7:37 pm Hi you all,
I have a strange problem. There are open DBF files that sometimes close themselves. I cannot give an example code, because it happens randomly in different functions. In that case I get an error notification I log the open files, but it says there are no open DBF files.
Have anyone experienced something like this before? Any tips on how to handle it?
Can you post your code and the errorlog file ?? maybe we can help you.
Best regards,
Salamandra, Brazil
There is one time in which is crucial awakening. That time is now. ( Buddha )
Re: DBF close problem
Hi Salamandra,
Thank you for your answer.
Unfortunately, there is no problem with the same DBF. Plus, not in the same part of the program. This is a great program with diverse parts. Sometimes I refer to a DBF's field in a simple list and since it is not open and I get an error message. But after that I use the same function many times and no problem. It only comes out very rarely, but always elsewhere. There is a way that all open DBF are closed in another function. It can also occur on different computers. I don't think there is an error in the program, maybe it could be a memory problem or something else (?)
Thank you for your answer.
Unfortunately, there is no problem with the same DBF. Plus, not in the same part of the program. This is a great program with diverse parts. Sometimes I refer to a DBF's field in a simple list and since it is not open and I get an error message. But after that I use the same function many times and no problem. It only comes out very rarely, but always elsewhere. There is a way that all open DBF are closed in another function. It can also occur on different computers. I don't think there is an error in the program, maybe it could be a memory problem or something else (?)
Re: DBF close problem
Does this problem happen e.g. after calling the print preview, saving the printout to pdf/jpg, using functions such as GetFile, PutFile, GetFolder, etc.?
I had such an issue and it resulted from changing the current working folder after triggering the above events. From now on, just in case, after these operations, I return to the correct working folder by hb_CWD().
I had such an issue and it resulted from changing the current working folder after triggering the above events. From now on, just in case, after these operations, I return to the correct working folder by hb_CWD().
Re: DBF close problem
Thank you Edward,
I use the dirchange() instead of hb_cwd(). But i will rewrite it to hb_cwd().
Although I did not change folders for these parts. However, what you wrote gave me an idea. I also write the path of the current folder to the error log. Maybe this will also help detect the error.
I use the dirchange() instead of hb_cwd(). But i will rewrite it to hb_cwd().
Although I did not change folders for these parts. However, what you wrote gave me an idea. I also write the path of the current folder to the error log. Maybe this will also help detect the error.
Re: DBF close problem
I checked and the error log is created in the current job folder. So not sure that the folder change is the problem in my case. 

-
- Posts: 20
- Joined: Sun Dec 04, 2016 1:43 pm
- DBs Used: DBF
- Location: Murcia - España
Re: DBF close problem
I have had similar problems in w10 when the disks go inactive, I don't know if this will be the case
------------------------------------------------
Translated with google
------------------------------------------------
Translated with google
Celes
Saludos / Regards
-
Cuanto mas simple mejor !! / The simpler the better !!
Saludos / Regards


Re: DBF close problem
I think like edk. I had a new user and all of a sudden I had program crashes. I found out she was printing to file from print preview. I had to blank out
the print to file on print preview window. For some reason, after picking a file name in another folder of c drive it did not come back to currentfolder.
A while back Serge suggested and I do the same is open the tables I want to use in all programs and close them when I leave that program. I use
modal windows mostly so this really saves getting lost by being able to go all over the place and not knowing where you came from.
the print to file on print preview window. For some reason, after picking a file name in another folder of c drive it did not come back to currentfolder.
A while back Serge suggested and I do the same is open the tables I want to use in all programs and close them when I leave that program. I use
modal windows mostly so this really saves getting lost by being able to go all over the place and not knowing where you came from.
All The Best,
Franco
Canada
Franco
Canada
- AUGE_OHR
- Posts: 2093
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: DBF close problem
hi,
how "fast" are you testing DBF
are you working in Network
as Edward say most it is Energe-Saving under Windows 10
but it is not "Disk" I/O ... it is the Network Card which goes "sleep"
---
i can close my Laptop and normal all is going "sleep"
but when my Xbase++ App is still running i do not want any Power-Saving when close Laptop
to disable Power-Saving i use this
this Code i use under Xbase++ using Ot4XB Syntax
see https://docs.microsoft.com/en-us/window ... utionstate
how "fast" are you testing DBF

are you working in Network

as Edward say most it is Energe-Saving under Windows 10
but it is not "Disk" I/O ... it is the Network Card which goes "sleep"
---
i can close my Laptop and normal all is going "sleep"
but when my Xbase++ App is still running i do not want any Power-Saving when close Laptop
to disable Power-Saving i use this
Code: Select all
PROCEDURE MAIN()
SetStandbyOFF(.T.)
// run App
SetStandbyOFF(.F.)
QUIT
RETURN
Code: Select all
FUNCTION SetStandbyOFF(lOnOff)
LOCAL nRet := 0
DEFAULT lOnOff TO .F.
IF lOnOff = .T.
nRet := @KERNEL32:SetThreadExecutionState( nOr(ES_CONTINUOUS, ES_SYSTEM_REQUIRED,ES_DISPLAY_REQUIRED ,ES_AWAYMODE_REQUIRED) )
ELSE
nRet := @KERNEL32:SetThreadExecutionState( ES_CONTINUOUS )
ENDIF
RETURN nRet
have fun
Jimmy
Jimmy
Re: DBF close problem
Thank you very much for your help.
The comments were helpful, I will scan the program based on them and i will check the win10 settings.
The comments were helpful, I will scan the program based on them and i will check the win10 settings.