Hi elrosa,
These errors mean that are missing these functions. I don't know LetoDb, but I know that you need Harbour version 3.2 or 3.4. You are using the Harbour 3.0.
See this topic too: Letodb no linux ubuntu 12.04.
Moderador: Moderadores
Function Main
LOCAL cPath
request leto
rddsetdefault( "LETO" )
set date format "dd/mm/yy"
cPath:= "//25.77.144.122:2812/"
carq="CLIE01"
use (cpath+carq) new
browse()
close
RETU
A pergunta é: Como usar o Letodb se o executavel estiver no servidor, juntamente com os dados e não no PC do cliente ?
C:\fontes\SCI_WIN>ping google.com
Disparando google.com [172.217.2.174] com 32 bytes de dados:
Resposta de 172.217.2.174: bytes=32 tempo=619ms TTL=53
Resposta de 172.217.2.174: bytes=32 tempo=600ms TTL=53
Resposta de 172.217.2.174: bytes=32 tempo=612ms TTL=53
Resposta de 172.217.2.174: bytes=32 tempo=572ms TTL=53
Estatísticas do Ping para 172.217.2.174:
Pacotes: Enviados = 4, Recebidos = 4, Perdidos = 0 (0% de
perda),
Aproximar um número redondo de vezes em milissegundos:
Mínimo = 572ms, Máximo = 619ms, Média = 600ms
Então, cPath:= "//25.77.144.122:2812/"
ou cPath := "172.217.2.174:2812" ou cPath := "google.com:2812"
c:\xyz>teste.exe //192.168.1.20:2812/
function main(cPath)
hb_default(@cPath,"localhost")
cServidor := Hwg_GetIni('Config','Servidor' ,,cIniFile)
//Fragmento de código para dar uma ideia.
BEGIN SEQUENCE WITH {| oErr | Break( oErr ) }
If lRddLeto
If Leto_File(cServidor+cDB)
DbUseArea(.T.,"LETO",cServidor+cDB,Apel,.T.,.F.,'PTISO')
Else
hwg_Msgstop('LetoDb Não Localizou o Arquivo: ' + cServidor + cDB)
lRet := .F.
EndIf
Else
DbUseArea(.T.,'DBFCDX',dDados+cDB,Apel,.T.,.F.,'PTISO')
EndIf
cPath:="//servidor:2812/"
IF ( leto_Connect( "localhost",,,30000 ) ) < 0 //Default is 120.000 aka 2 minutes.
//ou
IF ( leto_Connect( "127.0.0.1",,,30000 ) ) < 0 //Default is 120.000 aka 2 minutes.
...
Error TERM/2014 Create error: //127.0.0.1:2812/TEXTO.TXT
(OS Error 123)
Error TERM/2014 Create error: TESTE.TXT
(OS Error 3)
Quit Retry Default
//server.prg
FUNCTION leto_Set( nSet, xPar1, xPar2 )
RETURN Set( nSet, xPar1, xPar2 )
static void open_handle( PHB_SET_STRUCT pSet, const char * file_name,
HB_BOOL fAppend, HB_set_enum set_specifier )
{
HB_STACK_TLS_PRELOAD
PHB_ITEM pError = NULL;
PHB_FILE handle, * handle_ptr;
HB_ERRCODE uiError;
const char * szDevice = NULL, * def_ext;
char * szFileName = NULL;
char ** set_value;
HB_BOOL fPipe = HB_FALSE, fStripEof;
HB_TRACE( HB_TR_DEBUG, ( "open_handle(%p, %s, %d, %d)", ( void * ) pSet, file_name, ( int ) fAppend, ( int ) set_specifier ) );
switch( set_specifier )
{
case HB_SET_ALTFILE:
uiError = 2013;
set_value = &pSet->HB_SET_ALTFILE;
handle_ptr = &pSet->hb_set_althan;
def_ext = ".txt";
break;
case HB_SET_PRINTFILE:
uiError = 2014;
set_value = &pSet->HB_SET_PRINTFILE;
handle_ptr = &pSet->hb_set_printhan;
def_ext = ".prn";
break;
case HB_SET_EXTRAFILE:
uiError = 2015;
set_value = &pSet->HB_SET_EXTRAFILE;
handle_ptr = &pSet->hb_set_extrahan;
def_ext = ".prn";
break;
default:
return;
}
if( file_name && file_name[ 0 ] != '\0' )
{
#if defined( HB_OS_UNIX )
fPipe = file_name[ 0 ] == '|';
if( fPipe )
szFileName = hb_strdup( file_name );
else
#endif
{
szDevice = is_devicename( file_name );
if( szDevice )
{
szFileName = hb_strdup( szDevice );
def_ext = NULL;
#if defined( HB_OS_WIN ) || defined( HB_OS_DOS )
fAppend = HB_TRUE;
#endif
}
else
szFileName = hb_strdup( file_name );
}
}
/* free the old value before setting the new one (CA-Cl*pper does it).
* This code must be executed after setting szFileName, [druzus]
*/
close_handle( pSet, set_specifier );
if( *set_value )
{
hb_xfree( *set_value );
*set_value = NULL;
}
if( ! szFileName )
return;
fStripEof = fAppend && szDevice == NULL && ! fPipe;
/* Open the file either in append (fAppend) or truncate mode (! fAppend), but
always use binary mode */
/* QUESTION: What sharing mode does Clipper use ? [vszakats] */
do
{
if( fPipe )
handle = hb_filePOpen( szFileName + 1, "w" );
else
handle = hb_fileExtOpen( szFileName,
hb_stackSetStruct()->HB_SET_DEFEXTENSIONS ? def_ext : NULL,
( ! fStripEof || set_specifier == HB_SET_PRINTFILE ? FO_WRITE : FO_READWRITE ) |
FO_DENYWRITE | FXO_SHARELOCK |
( fAppend ? FXO_APPEND : FXO_TRUNCATE ) |
( szDevice ? 0 : FXO_DEFAULTS ),
NULL, pError );
if( handle == NULL )
{
pError = hb_errRT_FileError( pError, HB_ERR_SS_TERMINAL, EG_CREATE, uiError, szFileName );
if( hb_errLaunch( pError ) != E_RETRY )
break;
}
}
while( handle == NULL );
if( pError )
hb_itemRelease( pError );
if( handle != NULL && fStripEof )
{
/* Position to EOF */
if( hb_fileSeek( handle, 0, FS_END ) > 0 )
{
/* Special binary vs. text file handling - even for UN*X, now
that there's an HB_SET_EOF flag. */
/* PRINTFILE is always binary and needs no special handling. */
if( set_specifier != HB_SET_PRINTFILE )
{
/* All other files are text files and may have an EOF
('\x1A') character at the end (both UN*X and non-UN*X,
now that theres an HB_SET_EOF flag). */
char cEOF = '\0';
hb_fileSeek( handle, -1, FS_END ); /* Position to last char. */
hb_fileRead( handle, &cEOF, 1, -1 ); /* Read the last char. */
if( cEOF == '\x1A' ) /* If it's an EOF, */
hb_fileSeek( handle, -1, FS_END ); /* Then write over it. */
}
}
}
/* user RT error handler can open it too so we have to
* close it again if necessary
*/
if( handle == NULL )
{
hb_xfree( szFileName );
szFileName = NULL;
}
close_handle( pSet, set_specifier );
*handle_ptr = handle;
if( *set_value )
hb_xfree( *set_value );
*set_value = szFileName;
}
int hb_setUpdateEpoch( int iYear )
{
if( iYear >= 0 && iYear < 100 )
{
int iEpoch = hb_setGetEpoch();
int iCentury = iEpoch / 100;
if( iYear < iEpoch % 100 )
++iCentury;
iYear += iCentury * 100;
}
return iYear;
}
Resultando que Set(24,..), não tem tratamento adequado no ambiente Leto.
Set(24, (xArquivo), .F.) ou Set Print to (xarquivo)
Set(24, (xArquivo), .F.) ou Set Print to (xarquivo)
Usuários vendo este fórum: Nenhum usuário registrado online e 9 visitantes