lorenzoazz wrote:Thanks for the reply.
Consider that, the problem rises when hardware goes in suspension mode, so it happens when in stand-by,
while you take a coffee break.
I mean, if the hardware do not go in stand-by (as a notebook does) , there is no error when i go to recording!
I cannot PREVENT the stand-by event, so i cannot dbcommit() before replace()...
while ! File( "myfile.txt" )
SysRefresh()
end
Antonio Linares wrote:Lorenzo,
Maybe you can first check if a file exists to force the wake up of the computer:
- Code: Select all Expand view
while ! File( "myfile.txt" )
SysRefresh()
end
/*
* check if index was updated by other process and if it was discard buffers
*/
static void hb_cdxIndexCheckVersion( LPCDXINDEX pIndex )
{
BYTE byBuf[8];
ULONG ulVer, ulFree;
if ( hb_fsSeek( pIndex->hFile, 0x04, FS_SET ) != 0x04 ||
hb_fsRead( pIndex->hFile, byBuf, 8 ) != 8 )
{
if ( pIndex->lockWrite > 0 && hb_fsSeek( pIndex->hFile, 0, FS_END ) == 0 )
memset( byBuf, 0, 8 );
else
hb_errInternal( 2155, "hb_cdxIndexCheckVersion: Read error on index heading page.", NULL, NULL );
}
karinha wrote:2155 Read error on index heading page
Explanation: A read error occurred when reading the heading page of
the index file, or the header did not contain the .ntx/cdx signature, or the
macro compiler returned a syntax error when attempting to compile the
key expression.
Action: Recreate the index file and check the key expression. Make
sure the database header is updated before index recreation.
#Include "FiveWin.Ch"
#Include "Directry.ch"
#Include "Ord.Ch"
FUNCTION INDEX()
... DIALOG AND BUTTONS, ETC
... ACTION... ReIndPack( oMeter1, oMeter2, oMeter3 )
RETURN NIL
FUNCTION ReIndPack( oMeter1, oMeter2, oMeter3 )
LOCAL Del_Indice
EXTERNAL DESCEND
DEL_INDICE := DIRECTORY( "*.CDX" )
FOR I = 1 TO LEN( Del_Indice )
FERASE( DEL_INDICE[I][1] )
NEXT I
IF NetUse( "CONVENIO", .F. )
oMeter1:nTotal = RecCount()
INDEX ON VAL(Field->CODIGO) TAG CODIGO TO CONVENIO ;
FOR !DELETED() ;
EVAL ( oMeter1:Set( RecNo() ), CursorWait(), SysRefresh() ) ;
EVERY 10
INDEX ON Field->NOME TAG NOME TO CONVENIO ;
FOR !DELETED() ;
EVAL ( oMeter1:Set( RecNo() ), CursorWait(), SysRefresh() ) ;
EVERY 10
DbCloseAll()
ENDIF
RETURN NIL
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: karinha, Silvio.Falconi and 21 guests