Itamar,
O meu CVS não baixa nenhuma atualização do letodb a muito tempo.
Houve alguma mudança?

Moderador: Moderadores
Itamar M. Lins Jr. escreveu://fragmentos do código que eu uso.
02 Local cHost := "//localhost:2812/"
03
04 nConect := leto_Connect( cHost )
05 IF nConect == -1
06 nRes := leto_Connect_Err()
07 IF nRes == LETO_ERR_LOGIN
08 MsgStop( "Falha ao Logar" )
09 ELSEIF nRes == LETO_ERR_RECV
10 MsgStop( "Error ao conectar" )
11 ELSEIF nRes == LETO_ERR_SEND
12 MsgStop( "Erro de envio" )
13 ELSE
14 MsgStop( "Não connectado ao servidor: " + cHost )
15 ENDIF
16 Return .f.
17 ENDIF
18 EndIf
19
20 Function AbreDB(...)
21
22 BEGIN SEQUENCE WITH {| oErr | Break( oErr ) }
23 If lRddLeto
24 If Leto_File(cHost+Db)
25 DbUseArea(.t.,"LETO",cHost+DB,apel,.T.,.F.,'PTISO')
26 Else
27 MsgStop('LetoDb Não Localizou o Arquivo: '+cHost+Db)
28 lRet := .f.
29 EndIf
30 Else
31 DbUseArea(.t.,'DBFCDX',dDados+DB,apel,.T.,.F.,'PTISO')
32 EndIf
33
34 Recover
35 If lRddleto
36 msginfo('Erro, abrindo Arquivo: '+cHost+Db+' Compartilhado')
37 Else
38 msginfo('Erro, abrindo Arquivo: '+dDados+Db+' Compartilhado')
39 EndIF
40 lRet := .f.
41 End Sequence
42
43 if Neterr()
44 MsgInfo('Usado de Forma Exclusiva, Em Outro Lugar.')
45 lRet := .f.
46 endif
Pass_for_Login = 0 - if 1, user authentication is necessary to
login to the server;
Pass_for_Manage = 0 - if 1, user authentication is necessary to
use management functions ( Leto_mggetinfo(), etc. );
Pass_for_Data = 0 - if 1, user authentication is necessary to
have write access to the data;
Pass_File = "leto_users" - the path and name of users info file;
Crypt_Traffic = 0 - if 1, the data passes to the network encrypted;
Share_Tables = 0 - if 0 (default, this mode server was the only from the
start of a letodb project), the letodb opens all
tables in an exclusive mode, what allows to increase
the speed. If 1 (new mode, added since June 11, 2009),
tables are opened in the same mode as client
applications opens them, exclusive or shared, what
allows the letodb to work in coexistence with other
types of applications.
#ifdef __WIN_DAEMON__
StartServer()
#endif
#ifdef __WIN_SERVICE__
IF cCommand != NIL
IF Lower( cCommand ) == "install"
IF leto_serviceInstall()
WrLog( "LetoDB service has been successfully installed" )
ELSE
WrLog( "Error installing LetoDB service: " + Str( letowin_GetLastError() ) )
ENDIF
RETURN
ELSEIF Lower( cCommand ) == "uninstall"
IF leto_serviceDelete()
WrLog( "LetoDB service has been deleted" )
ELSE
WrLog( "Error deleting LetoDB service: " + Str( letowin_GetLastError() ) )
ENDIF
RETURN
ELSEIF Lower( cCommand ) == "test"
StartServer()
RETURN
ELSE
? "LetoDB_mt { install | uninstall }"
ENDIF
RETURN
ENDIF
IF ! leto_serviceStart( "StartServer" )
WrLog( "LetoDB service has had some problems: " + Str( letowin_GetLastError() ) )
ENDIF
//!!!!!!!!!!!!!!! DO WHILE win_serviceGetStatus() == WIN_SERVICE_RUNNING
#endif
#ifdef __LINUX_DAEMON__
IF !leto_Daemon()
WrLog( "Can't become a daemon" )
RETURN
ENDIF
StartServer()
#endif
// TESTES LETODB 29/12/2012 AS 11:30 HS
Function Main
Local corant := SETCOLOR()
CLS
Set AutOpen on
REQUEST DBFCDX,LETO
DBSETDRIVER("dbfcdx")
RDDSETDEFAULT( "LETO" )
RESTORE FROM csconfig ADDITIVE
// ARQUIVO LOCAL TEM QUE TER VIA DBFCDX
USE ( "ARPARLOC" ) VIA "DBFCDX" NEW
ARMCAMVAR()
CLOSE
PRIVATE cPath := ALLTRIM(endserd)
PRIVATE dirserd := cPath
leto_disconnect()
IF ( leto_Connect( cPath ) ) == -1
alert("Nao foi possivel conectar ao Servidor")
close all
quit
endif
DADOS := leto_mggetinfo()
@ 01,01 SAY DADOS[1]
@ 02,01 SAY DADOS[2]
@ 03,01 SAY DADOS[3]
@ 04,01 SAY DADOS[4]
@ 05,01 SAY DADOS[5]
@ 06,01 SAY DADOS[6]
@ 07,01 SAY DADOS[7]
@ 08,01 SAY DADOS[8]
@ 09,01 SAY DADOS[9]
@ 10,01 SAY DADOS[10]
@ 11,01 SAY DADOS[11]
@ 12,01 SAY DADOS[12]
@ 13,01 SAY DADOS[13]
@ 14,01 SAY DADOS[14]
@ 15,01 SAY DADOS[15]
@ 16,01 SAY DADOS[16]
@ 17,01 SAY DADOS[17]
@ 23,01 SAY cPath+" "+endserd+" "+dddosser
@ 24,01 SAY dirserd COLOR "W/B"
if leto_file( dirserd+"cadprodu.dbf") = .t.
ALERT( "ENCONTRADO "+dirserd+" CADPRODU" )
ELSE
ALERT( "NAO ENCONTRADO "+dirserd+" CADPRODU" )
ENDIF
use ( dirserd+"CADPRODU" ) New
SET INDEX TO ( dirserd+"CADPRODU" )
SET ORDER TO 2
GO TOP
browse(1,1,22,78)
close all
LETO_DISCONNECT()
SETCOLOR(corant)
CLS
quit
Return Nil
FUNCTION Armcamvar
nc = FCOUNT()
FOR av = 1 TO nc
IF TYPE(FIELD(av)) <> 'M'
nomecampo := FIELDNAME(av)
nomevar := nomecampo + "d"
PUBLIC &nomevar
&nomevar := &nomecampo
ENDIF
NEXT av
RETURN(.T.)
* FIM DESTE MODULO
[MAIN]
Port = 2812
DataPath = G:\SISTEMA
Logfile = "letodb.log"
Default_Driver = CDX
Lower_Path = 0 ; 1, converter todos os caminhos para minúsculas
EnableFileFunc = 1 ; 1, Ativa leto_file(), leto_ferase(), leto_frename()
EnableAnyExt = 0 ; 1, é Ativado a criação de arquivos de dados (DBF)
Pass_for_Login = 0 ; 1, autenticação do usuário é necessária p/ acessar
Pass_for_Manage = 0 ; 1, a autenticação necessária p/ func Leto_mggetinfo()
Pass_for_Data = 0 ; 1, a autenticação necessária acesso aos dados
Pass_File = "leto_users" ; caminho, arquivo de informações dos usuários
Crypt_Traffic = 0 ; 1, passa os dados pela a rede cripitografado
[DATABASE]
DataPath = G:\SISTEMA
Driver = CDX
; NAO ALTERAR SEM CONSULTA PREVIA
; LETODB.INI ALTERADO EM 29/12/2012 AS 11:06 HS
; ANALISTA PARA CONSULTA: ALBERTO DIAS
; CENTRAL SOFTWARE INFORMATICA LTDA
; SERVIDOR ATUAL 192.168.0.11 PORTA 2812
cPasta:="BOLETOS_DB_"+HB_DTOC(Date(),"YYYY_MM_DD")+"-"+Left(StrTran(Time(),":"),4)
LETO_UDF("UDF_Backup",cPasta,"numero.dbf")
//Função no server.prg
FUNCTION UDF_Backup( cPasta, cArquivo )
LOCAL I, lErro:=.F., nErro
HB_Default(@cArquivo,"")
HB_Default(@cPasta,"DB_"+HB_DTOC(Date(),"YYYY_MM_DD")+"-"+Left(StrTran(Time(),":"),4))
TRY
IF !IsDir(cPasta)
DirMake(cPasta)
ENDIF
__CopyFile("DB"+HB_PS()+cArquivo,cPasta+HB_PS()+cArquivo)
CATCH
lErro:=.T.
END
RETURN lErro
Sem duvida o TS é muito mais rápido que LETODB(em rede e por internet), e também sem duvida o LETODB é mais seguro e mais rápido que DBFCDX.
FUNCTION UDF_Backup( nUserStru, cPasta, cArquivo )
LOCAL I, lErro:=.F., nErro
HB_Default(@cArquivo,"")
HB_Default(@cPasta,"DB_"+HB_DTOC(Date(),"YYYY_MM_DD")+"-"+Left(StrTran(Time(),":"),4))
TRY
IF !IsDir(cPasta)
DirMake(cPasta)
//strfile(cArquivo+HB_EOL(),"TESTE.LOG",.T.)
ENDIF
__CopyFile("DB"+HB_PS()+cArquivo,cPasta+HB_PS()+cArquivo)
CATCH
lErro:=.T.
END
RETURN lErro
FUNCTION UDF_Backup( nUserStru, cPasta, cArquivo )
LOCAL I, lErro:=.F., nErro
HB_Default(@cArquivo,"")
HB_Default(@cPasta,"DB_"+HB_DTOC(Date(),"YYYY_MM_DD")+"-"+Left(StrTran(Time(),":"),4))
TRY
IF !IsDir(hb_dirbase()+cPasta)
DirMake(hb_dirbase()+cPasta)
ENDIF
__CopyFile(hb_dirbase()+"DB"+HB_PS()+cArquivo,hb_dirbase()+cPasta+HB_PS()+cArquivo)
CATCH
lErro:=.T.
END
RETURN lErro
Usuários vendo este fórum: Nenhum usuário registrado online e 8 visitantes