ola amigos
boa tarde Itamar
eu estava tentando usar o letodb mas até quando escrevo não consegui sucesso.
baixei o letodb, instalei, ativei o serviço, verifico em serviço e esta funcionando, liberei no firewall (cheguei ate desativar o firewall do Windows) liberei porta no roteador e tudo mais, montei os exemplo que vc postou compilei em harbour e deram vários erros, montei Harbour MiniGUI Extended Edition 18.10 (Update 1) e deu erro
procurei algum programa compilado e achei um tal de MANEGE mas quando coloco o IP 127.0.0.1 ou localhost aparece mensagem NO CONECT, como é um executável não da pra saber exatamente o que esta fazendo.
abaixo mostro os erros encontrados para compilar um exe para conctar o letodb em harbour
C:\FONTES\HARBOUR\letodb>compile
C:\FONTES\HARBOUR\letodb>C:\HB32\BIN\HBMK2 TESTEDB.HBP
hbmk2[TESTEDB]: Atenção: Arquivo de saída não portável "Non-portable":
'-oTESTEDB.EXE' in TESTEDB.HBP:7. Excluindo '.EXE' estensão.
hbmk2: Linkando... TESTEDB.EXE
c:/hb32/comp/mingw/bin/../lib/gcc/mingw32/4.6.1-dw2/../../../../mingw32/bin/ld.exe: cannot find -llibrddleto
collect2: ld returned 1 exit status
hbmk2[TESTEDB]: Erro: Executando linkeditor. 1
C:\HB32\comp\mingw\bin\gcc.exe .hbmk/win/mingw/TESTEDB.o .hbmk/win/mingw/_hbmkaut_TESTEDB.o -mconsole -Wl,--start-group -lhbct -lxhb -lhbwin -lhbnf -llibrddleto -lhbextern -lhbdebug -lhbvm -lhbrtl -lhblang -lhbcpage -lgtcgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbrdd -lhbuddall -lhbusrrdd -lrddntx -lrddcdx -lrddnsx -lrddfpt -lhbrdd -lhbhsx -lhbsix -lhbmacro -lhbcplr -lhbpp -lhbcommon -lhbmainstd -lkernel32 -luser32 -lgdi32 -ladvapi32 -lws2_32 -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -luuid -lole32 -loleaut32 -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -lwininet -lhbpcre -lhbzlib -Wl,--end-group -oTESTEDB.EXE -LC:/HB32/lib/win/mingw
C:\FONTES\HARBOUR\letodb>
o compile acima nada mais é que uma bat = C:\HB32\BIN\HBMK2 TESTEDB.HBP
como esta meu arquivo TESTEDB.HBP
-lhbct
-inc
-lxhb
-lhbwin
-lhbnf
-oTESTEDB.EXE
TESTEDB.PRG
TESTELETODB.HBC
como esta meu arquivo TESTELETODB.HBC
{win}incpaths=c:\letodb\include;
{win}libpaths=c:\letodb\lib;
{win}libs=librddleto
e por fim como esta meu TESTEDB.PRG
*#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
//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+"meu_arquivo.cdx"
cDbf := cPATH+"meu_aquivo.dbf"
DbUseArea(.t.,'LETO',cDbf,"alias_xyz",.T.,.F.,'PTISO')
If leto_file(cIndex)
DBSETINDEX( cIndex )
Else
* index on ...//seu código
* index on ... //seu código
EndIf
return
agora o erro em Harbour MiniGUI Extended Edition 18.10 (Update 1)
C:\FONTES\MINIGUI\LETODB>compile
C:\FONTES\MINIGUI\LETODB>call c:\MiniGuI\batch\compile.bat MAIN
Harbour 3.2.0dev (r1809141336)
Copyright (c) 1999-2018, https://harbour.github.io/
Compiling 'MAIN.prg'...
Lines 22145, Functions/Procedures 2
Generating C source output to 'MAIN.c'... Done.
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
MAIN.c:
Borland Resource Compiler Version 5.40
Copyright (c) 1990, 1999 Inprise Corporation. All rights reserved.
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_HB_FUN_LETO_CONNECT' referenced from C:\FONTES\MINIGUI\LETODB\MAIN.OBJ
Error: Unresolved external '_HB_FUN_LETO' referenced from C:\FONTES\MINIGUI\LETODB\MAIN.OBJ
Link error.
Pressione qualquer tecla para continuar. . .
o compile.bat
call c:\MiniGuI\batch\compile.bat MAIN %1 %2 %3 %4 %5 %6 %7 %8 %9
o main.prg
#include <minigui.ch>
FUNCTION Main()
Load Window Main
Main.Center
Main.Activate
return
function iniciar()
LOCAL cServer:='//mariculturamzt.serveftp.com:2812/'
REQUEST LETO
RDDSETDEFAULT("LETO")
IF Leto_Connect(cServer)==-1
MSG('No hay conexion con el servidor '+cServer)
RETURN NIL
ELSE
MSG('Servidor a la escucha en '+cServer)
ENDIF
DBCreate( cServer+'prueba1',{; //Creamos la tabla en el servidor
{'Campo1','N', 3,0},;
{'Campo2','C', 15,0},;
{'Fecha' ,'D', 8,0};
})
DBUseArea(.T.,,cServer+'prueba1','Prueba1') //Abrimos la tabla
//Tabien puede usarse el comando USE ( cServer+'prueba1' ) New
INDEX ON Campo1 TAG Campo1 //Creamos indice
//--
FOR i:=1 TO 100 //Creamos 100 registros
Prueba1->(RLock()) //y grabamos información en los campos
Prueba1->(DBAppend())
Prueba1->Campo1:= i
Prueba1->Campo2:= 'Registro '+Str(i,3)
Prueba1->Fecha := Date()
Prueba1->(DBUnlock())
NEXT
Prueba1->(DBSeek(50))
MSG(Prueba1->Campo2)
edit extended workarea prueba1
Prueba1->(DBCloseArea())
RETURN NIL
#pragma BEGINDUMP
#include "windows.h"
#include "hbapi.h"
HB_FUNC( MSG )
{
MessageBox( GetActiveWindow(), hb_parc(1), "Ok", 0 );
}
#pragma ENDDUMP
o main.fmg
* Harbour MiniGUI IDE Two-Way Form Designer Generated Code
* (c)2004-2009 Roberto Lopez <harbourminigui@gmail.com>
* http://harbourminigui.googlepages.com
DEFINE WINDOW TEMPLATE AT 138 , 235 WIDTH 550 HEIGHT 350 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "" ICON NIL MAIN CURSOR NIL ON INIT iniciar() ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR Nil NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil
DEFINE LABEL Label_1
ROW 10
COL 30
WIDTH 470
HEIGHT 60
VALUE "LETODB WITH MINIGUI"
FONTNAME "Arial"
FONTSIZE 24
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
DEFINE BUTTON Button_1
ROW 120
COL 190
WIDTH 100
HEIGHT 28
ACTION THISWINDOW.RELEASE
CAPTION "EXIT"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
HELPID Nil
FLAT .F.
TABSTOP .T.
VISIBLE .T.
TRANSPARENT .F.
MULTILINE .F.
PICTURE Nil
END BUTTON
DEFINE HYPERLINK HyperLink_1
ROW 260
COL 140
WIDTH 230
HEIGHT 28
VALUE "http://bielsys.blogspot.com/2008/07/letodb-rdd-cliente-servidor-para.html"
ADDRESS "http://bielsys.blogspot.com/2008/07/letodb-rdd-cliente-servidor-para.html"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
AUTOSIZE .F.
HELPID Nil
VISIBLE .T.
HANDCURSOR .F.
BACKCOLOR Nil
FONTCOLOR Nil
END HYPERLINK
DEFINE LABEL Label_2
ROW 180
COL 30
WIDTH 480
HEIGHT 60
VALUE "Sample based in next url adapted to Minigui"
FONTNAME "Arial"
FONTSIZE 15
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
END WINDOW
pode ser ate coisa simples de resolver mais já bati a cabeça o dia inteiro tentando descobrir e nada.
obrigado a todos
abraço