15 Mai 2018 13:44
hbmk2 -find hb_vf*
Núcleo Harbour (instalado):
hb_socketRecvFrom()
hb_vfAttrGet()
hb_vfAttrSet()
hb_vfClose()
hb_vfCommit()
hb_vfConfig()
hb_vfCopyFile()
hb_vfDirectory()
hb_vfDirExists()
hb_vfDirMake()
hb_vfDirRemove()
hb_vfDirSpace()
hb_vfEof()
hb_vfErase()
hb_vfExists()
hb_vfFlush()
hb_vfHandle()
hb_vfLink()
hb_vfLinkRead()
hb_vfLinkSym()
hb_vfLoad()
hb_vfLock()
hb_vfLockTest()
hb_vfMoveFile()
hb_vfOpen()
hb_vfRead()
hb_vfReadAt()
hb_vfReadLen()
hb_vfRename()
hb_vfSeek()
hb_vfSize()
hb_vfTempFile()
hb_vfTimeGet()
hb_vfTimeSet()
hb_vfTrunc()
hb_vfUnlock()
hb_vfWrite()
hb_vfWriteAt()
sx_VFGet()
15 Mai 2018 14:18
você tá querendo gerar um arquivo no servidor letodb ? é isso ?
cArq := "\\192..."
set printer to cArq
15 Mai 2018 14:39
Olá, já verificou as permissões na pasta ?
Deixa eu entender isso, você tá querendo gerar um arquivo no servidor letodb ? é isso ?
Não precisa do Letodbf para pegar o erro.
Isso não é erro do letodbf e ele também não faz isso, é preciso usar as funções hb_VF* do Harbour com as devidas permissões etc...
15 Mai 2018 15:00
22 Out 2018 14:48
Port = 2812
Logfile = "letodb.log"
DEFAULT_DRIVER = CDX
DATAPATH = c:\dados\
ENABLEFILEFUNC = 1
CRYPT_TRAFFIC = 0
PASS_FOR_LOGIN = 0
PASS_FOR_MANAGE = 0
PASS_FOR_DATA = 0
Share_Tables = 0
Cache_Records = 50
[DATABASE]
DataPath = c:\dados\
Driver = CDX
-otesteleto
-compr=yes
-quiet
-lxhb
-lhbwin
-lhbct
-prgflag=-b
-strip
-compr
rddleto.hbc
-iC:\letodb
TESTLETO.PRG
@echo off
CLS
set path=C:\hb32\bin;C:\hb32
CLS
HBMK2 TESTE.HBP
{win}incpaths=c:\letodb\include;
{win}libpaths=c:\letodb\lib;
{win}libs=rddleto
rddleto.hbc
// #require "sddodbc" //opcional se for usar MySql com LetoDb
// #require "sddfb" //opcional se for usar Firebird com Letodb
#include "rddleto.ch"
REQUEST DBFCDX, DBFFPT, DBFDBT, LETO
REQUEST HB_LANG_PT, HB_CODEPAGE_PTISO, HB_CODEPAGE_PT850
REQUEST SQLMIX, SDDODBC //opcional se for usar MySQL ou Firebird etc...
Function Main
Local cPATH := "//localhost:2812/" //não precisa informar o caminho dos DBF´s porque já foi informado(configurado) no arquivo leotdb.ini
REQUEST LETO
RDDSETDEFAULT("LETO")
//Conectando com o servidor LetoDb.
nConect := leto_Connect( cPath)
IF nConect == -1
nRes := leto_Connect_Err()
IF nRes == LETO_ERR_LOGIN
alert( "Falha ao Logar" )
ELSEIF nRes == LETO_ERR_RECV
alert( "Error ao conectar" )
ELSEIF nRes == LETO_ERR_SEND
alert( "Erro de envio" )
ELSE
alert( "Não connectado ao servidor: " + cPath )
ENDIF
Return .F.
ENDIF
cIndex := cPATH+"PRODUTOS.cdx"
cDbf := cPATH+"PRODUTOS.dbf"
DbUseArea(.t.,'LETO',"PROD",.T.,.F.,'PTISO')
If leto_file(cIndex)
DBSETINDEX( cIndex )
Else
* index on ...//seu código
* index on ... //seu código
index on codmercad to codigo
EndIf
return
22 Out 2018 18:27
{win}libpaths=c:\letodb\lib;
28 Out 2018 10:16
REQUEST LETO
RDDSETDEFAULT("LETO")
cPATH := "//localhost:2812/"
cIndex1 := cPATH + "codigo.cdx"
cIndex2 := cPATH + "desc.cdx"
USE (cPath+"PRODUTOS") SHARED
SET INDEX TO cIndex2,cIndex1
28 Out 2018 12:58
use produtos.dbf new shared
set index to ... // com "SET AUTOPEN ON", nem precisa disso o tal set index...
29 Out 2018 10:06
29 Out 2018 17:33
nConect := leto_Connect( cPath)
29 Out 2018 18:10
30 Out 2018 11:05
21 Nov 2018 09:11
procedure connect_server
local iSecs2
local iFalha := 0
local iSecs1 := abs( seconds() )
do while abs( seconds() - iSecs1 ) < 300
//se conseguimos conectar
if leto_Connect( "//192.168.0.1:2812/" ) <> -1
//se enxerguei o banco vamos tentar nos conectar
if leto_file( FILE_SERVER )
//vamos dizer ao programa que estamos conectado
bConected := .t.
//seleciono a area de trabalho com numero 6
select 6
//e vamos abrir o banco de dados do servidor no modo compartilhado
USE FILE_SERVER SHARED NEW ALIAS LAN
//se chegamos até aqui, se não houve erro na abertura do arquivo só resta sair do loop
if !neterr() .and. !empty( alias() )
exit
else
? "Erro ao abrir banco de dados"
inkey(0)
quit
endif
//se não conseguimos
else
//vamos dizer ao programa que ainda não nos conectamos
//mostramos na tela que estamos tentando
? "Tentativa de conexao com o banco de dados ",alltrim(str(++iFalha))," -> falha"
? "Proxima tentativa em 1 minuto"
? "Procurando...",FILE_SERVER
bConected := .f.
endif
//se não enxerguei o banco
else
//mostramos na tela que estamos tentando
? "Tentativa de conexao com o servidor ",alltrim(str(++iFalha))," -> falha"
? "Proxima tentativa em 1 minuto"
endif
if abs( seconds() - iSecs1 ) < 300
//aguardamos 1 minuto aqui
iSecs2 := abs( seconds() )
do while abs( seconds() - iSecs2 ) < 60
if inkey() == 27
quit
endif
enddo
else
exit
endif
enddo
//se ficamos aqui tentando por mais de 5 minutos
//e não conseguimos nos conectar
if abs( seconds() - iSecs1 ) >= 300
? "Fim das tentativas inciando local..."
//então dizemos ao programa que não conseguimos portanto tudo sera local
bConected := .f.
inkey(5)
endif
return
procedure dbxput_server(cField, xValor)
do while !dbrlock()
enddo
field->&cField := xValor
dbunlockall()
return
procedure update_dbf
dbcommitall()
return
@ 10,10 say "INCREMENTO REG 1: "+alltrim(str(LAN->REG1))
@ 11,10 say "INCREMENTO REG 2: "+alltrim(str(LAN->REG2))
@ 12,10 say "INCREMENTO REG 3: "+alltrim(str(LAN->REG3))
@ 13,10 say "INCREMENTO REG 4: "+alltrim(str(LAN->REG4))
@ 14,10 say "INCREMENTO REG 5: "+alltrim(str(LAN->REG5))
@ 15,10 say "INCREMENTO REG 6: "+alltrim(str(LAN->REG6))
@ 16,10 say "INCREMENTO REG 7: "+alltrim(str(LAN->REG7))
21 Nov 2018 11:49
Exit Func Encerrar() // chamada automaticamente quando o sistema é fechado.
Leto_DisConnect() // desconecta a conexão LetoDBf (Local ou não)...
Return Nil
21 Nov 2018 12:17
HardCommit = 0 - if 0, SET HARDCOMMIT OFF, this is now DEFAULT.
It is recommended for UNSTABLE running server to set it to <1>,
which means that each change at data tables are immedeate written to
harddrive bypassing the OS cache.