LISTBOX ALIAS
LISTBOX ALIAS
I have a listbox where I show the data.
I close the database and then I send the dbf-file back to the server.
In case that something goes wrong the user should return to the previous status.
select rechnung
use
oLbxRG:lCloseArea() // if I use lCloseArea the msginfo is ok otherwise I get an error
But then I find no way how to "oLbxRG:lOpenArea()" - how to rebind the oLbxRg again
lret := MEMOWRIT2(cSrc, cDSt )
lret := .f. //procl for testing a network error
if lret = .f.
Msginfo1 ( "N e t z w e r k f e h l e r" )
USE ( CurDir() + "\RECHNUNG" ) VIA "DBFCDX" NEW ALIAS RECHNUNG
oLbxRG:cAlias := "RECHNUNG"
endif
Best regards,
Otto
I close the database and then I send the dbf-file back to the server.
In case that something goes wrong the user should return to the previous status.
select rechnung
use
oLbxRG:lCloseArea() // if I use lCloseArea the msginfo is ok otherwise I get an error
But then I find no way how to "oLbxRG:lOpenArea()" - how to rebind the oLbxRg again
lret := MEMOWRIT2(cSrc, cDSt )
lret := .f. //procl for testing a network error
if lret = .f.
Msginfo1 ( "N e t z w e r k f e h l e r" )
USE ( CurDir() + "\RECHNUNG" ) VIA "DBFCDX" NEW ALIAS RECHNUNG
oLbxRG:cAlias := "RECHNUNG"
endif
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: LISTBOX ALIAS
Otto,
Class TWBrowse Method lCloseArea() calls DbCloseArea(), so after calling it you may need to USE the DBF again if you need to manage it again
Class TWBrowse Method lCloseArea() calls DbCloseArea(), so after calling it you may need to USE the DBF again if you need to manage it again
Re: LISTBOX ALIAS
Hello Antonio,
I tried to do this but with no result:
if lret = .f.
USE ( CurDir() + "\RECHNUNG" ) VIA "DBFCDX" NEW ALIAS RECHNUNG
oLbxRG:cAlias := "RECHNUNG"
oLbxRG:show()
oLbxRG:gotop()
oLbxRG:refresh()
endif
Best regards,
Otto
I tried to do this but with no result:
if lret = .f.
USE ( CurDir() + "\RECHNUNG" ) VIA "DBFCDX" NEW ALIAS RECHNUNG
oLbxRG:cAlias := "RECHNUNG"
oLbxRG:show()
oLbxRG:gotop()
oLbxRG:refresh()
endif
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: LISTBOX ALIAS
Otto,
Why do you close the DBF and try to open it again from the same browse ?
Why do you close the DBF and try to open it again from the same browse ?
Re: LISTBOX ALIAS
Antonio,
doesn't PPC open the dbf-exclusivly?
I will check if I can copy a opened dbf back to the server.
Best regards,
Otto
doesn't PPC open the dbf-exclusivly?
I will check if I can copy a opened dbf back to the server.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: LISTBOX ALIAS
Otto,
> doesn't PPC open the dbf-exclusivly?
I have not checked it myself
> doesn't PPC open the dbf-exclusivly?
I have not checked it myself
Re: LISTBOX ALIAS
Antonio,
It I try to copy the opened dbf i get a dbf on the server with 0 byte.
Best regards,
Otto
It I try to copy the opened dbf i get a dbf on the server with 0 byte.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: LISTBOX ALIAS
Otto,
Have you tried to copy it before USE ing it ?
How do you copy it ? What source code do you use ?
Have you tried to copy it before USE ing it ?
How do you copy it ? What source code do you use ?
Re: LISTBOX ALIAS
Antonio,
If the file is not opend all is working.
This is the code I use:
Best regards,
Otto
If the file is not opend all is working.
This is the code I use:
Best regards,
Otto
Code: Select all
#pragma BEGINDUMP
#include <hbapi.h>
#include <hbapiitm.h>
#include "hbapifs.h"
#include <aygshell.h>
#include <windows.h>
HB_FUNC( MEMOWRIT2 )
{
PHB_ITEM pFileName = hb_param( 1, HB_IT_STRING );
PHB_ITEM pString = hb_param( 2, HB_IT_STRING );
BOOL bWriteEof = FALSE; /* write Eof !, by default is .T. */
BOOL bRetVal = FALSE;
if( hb_parinfo(0) == 3 && ISLOG( 3 ) )
bWriteEof = hb_parl( 3 );
if( pFileName && pString )
{
FHANDLE fhnd = hb_fsCreate( ( BYTE * ) hb_itemGetCPtr( pFileName ), FC_NORMAL );
if( fhnd != FS_ERROR )
{
ULONG ulSize = hb_itemGetCLen( pString );
bRetVal = ( hb_fsWriteLarge( fhnd, ( BYTE * ) hb_itemGetCPtr( pString ), ulSize ) == ulSize );
/* NOTE: CA-Clipper will add the EOF even if the write failed. [vszakats] */
/* NOTE: CA-Clipper will not return .F. when the EOF could not be written. [vszakats] */
#if ! defined(OS_UNIX_COMPATIBLE)
{
if( bWriteEof ) /* if true, then write EOF */
{
BYTE byEOF = HB_CHAR_EOF;
hb_fsWrite( fhnd, &byEOF, sizeof( BYTE ) );
}
}
#endif
hb_fsClose( fhnd );
}
}
hb_retl( bRetVal );
}
HB_FUNC( DLGFULLSCREEN )
{
SHINITDLGINFO shidi;
memset( &shidi, 0, sizeof( SHINITDLGINFO ) );
shidi.dwMask = SHIDIM_FLAGS;
shidi.hDlg = ( HWND ) hb_parnl( 1 );
shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;
SHInitDialog( &shidi );
}
HB_FUNC( NUMSERIETARJETA )
{
BY_HANDLE_FILE_INFORMATION bHinfo;
memset( &bHinfo, 0 , sizeof(bHinfo) );
GetFileInformationByHandle( (HANDLE) hb_parnl(1), &bHinfo );
hb_retnl( bHinfo.dwVolumeSerialNumber );
}
#pragma ENDDUMP
//----------------------------------------------------------------------------//
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: LISTBOX ALIAS
Otto,
have you tried to USE the DBF in shared mode ?
have you tried to USE the DBF in shared mode ?
Re: LISTBOX ALIAS
Antonio,
thank you. SHARED works. But I am uncertain if SHARED is ready for use with PPC.
There are some posts in this forum which report of problems.
Would you suggest to use it?
Best regards,
Otto
thank you. SHARED works. But I am uncertain if SHARED is ready for use with PPC.
There are some posts in this forum which report of problems.
Would you suggest to use it?
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: LISTBOX ALIAS
Otto,
The FWPPC build that we published in march this year it is based on march Harbour and imo shared should work fine.
We were using a much more older Harbour previously so hence the shared complains. Anyhow, you tests will have the final word
The FWPPC build that we published in march this year it is based on march Harbour and imo shared should work fine.
We were using a much more older Harbour previously so hence the shared complains. Anyhow, you tests will have the final word
Re: LISTBOX ALIAS
Antonio,
thank you.
I shall install the new version of PPC and do more tests.
Best regards,
Otto
thank you.
I shall install the new version of PPC and do more tests.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
Re: LISTBOX ALIAS
Otto
Shared mode works OK with fwppc, my app uses it since quite a while
PS : i am using an old version of fwppc
Hth
Richard
Shared mode works OK with fwppc, my app uses it since quite a while
PS : i am using an old version of fwppc
Hth
Richard
Re: LISTBOX ALIAS
Hello Richard,
thank you for the information.
Best regards,
Otto
PS: Oh, a new photo!
thank you for the information.
Best regards,
Otto
PS: Oh, a new photo!
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************