Page 1 of 5
implement LETODB
Posted: Sun Apr 18, 2021 2:14 pm
by fouednoomen
Hi All Friends
Could you please help me to implement the LETODB step by step , I have already tried it alone but I did not arrive.
Thanks in advance
Re: implement LETODB
Posted: Sun Apr 18, 2021 6:01 pm
by mol
I'm using letodbf by Elch.
Works very good.
I'll try to write tomorrow
Re: implement LETODB
Posted: Sun Apr 18, 2021 9:12 pm
by luisvasquezcl
Hola Mol, es posible que puedas compartir ese conocimiento?. Gracias
Re: implement LETODB
Posted: Sun Apr 18, 2021 10:53 pm
by Claudio Ricardo
Hola Mol... Yo también estoy interesado ya que Netio me ha dado un par de dolores de cabeza
y en aplicaciones pequeñas ( 2-3 ps's en red local ) como que no se justifica usar SQL.
Google traducer:
Hello Mol ... I am also interested as Netio has given me a couple of headaches
and in small applications (2-3 ps's in local network) as it is not justified to use SQL.
Re: implement LETODB
Posted: Mon Apr 19, 2021 12:43 am
by salamandra
Hi Mol,
+1
Salamandra, Brazil
Re: implement LETODB
Posted: Mon Apr 19, 2021 4:30 am
by jorge.posadas
Mol.
I am also interested in using letobe
Re: implement LETODB
Posted: Mon Apr 19, 2021 6:22 am
by mol
First, to use leto, you have to include it to your project.
I think, everybody needs to use aloso local files via DBFCDX
In MAIN function you have to place code
Code: Select all
REQUEST LETO
REQUEST DBFCDX , DBFFPT
RDDSETDEFAULT( "DBFCDX" )
public cRDDDriver := "DBFCDX"
public cLocalRDDDriver := "DBFCDX"
public cLetoSerwer := ""
public nLetoSerwerPort := 2812
public lUseSerwerLeto := .f.
public nStatusLETO := -1
public cLetoSerwerPath := ""
After reading initials from .INI, I'm trying to establish connection with server:
Code: Select all
if !( empty(cLetoServer) .or. empty(nLetoServerPort) )
cLetoServerPath := "//"+alltrim(cLetoSerwer)+":"+alltrim(str(nLetoSerwerPort))+"/"
lUseSerwerLeto := ((nStatusLETO := LETO_CONNECT( cLetoSerwerPath, "", "")) >= 0)
if lUseSerwerLeto
RDDSETDEFAULT( "LETO" )
cRDDDriver := "LETO"
else
if lAllowWorkWithoutLetoSerwer
MsgStop("No connection with LETO server ")
else
MsgStop("No connection with LETO server. Program Abandoned")
quit
endif
endif
else
lUseSerwerLeto := .f.
endif
Now, it's easy to open areas
Code: Select all
if lLocalDB
lCreate := !file("MyFile.DBF")
else
lCreate := !Leto_file("MyFile.DBF")
endif
if lCreate
// create procedure here
endif
DBUseArea(.T., if(lLocalDB, "DBFCDX","LETO"), "MyFile.DBF", .f., .f.)
After that, you can access MyFile.DBF via LETO in the same way as via DBFCDX
Re: implement LETODB
Posted: Mon Apr 19, 2021 7:31 am
by fouednoomen
Many thanks Mol for your prompt response ,
I also need the library implementation necessary to run LETODB and how to install LETODB in the server
Thanks
Re: implement LETODB
Posted: Mon Apr 19, 2021 8:35 am
by mol
I can pass compiled library and server service
you can install letodb as a service:
you have to put .ini file in letodbfsvc directory
My letodb.ini is like this:
Code: Select all
[Main]
; server port number;
; Port = 2812
; connection timeout;
; TimeOut = -1
; path to a data directory on a server;
DataPath=d:\projekty
;
;logowanie na hasło
Pass_for_login=0
Pass_form_manage=0
Pass_for_Data=0
;
;
; path and name of a log file;
; Logpath = letodb.log
; default RDD to open files on server ( CDX/NTX );
Default_Driver = CDX
; memo type ( FPT/DBT ). Default: FPT for DBFCDX, DBT for DBFNTX;
; Memo_Type = FPT
; if 1, convert all paths to lower case;
; Lower_Path = 0
; if 1, using of file functions ( leto_file(),
; leto_ferase(), leto_frename() is enabled;
EnableFileFunc = 1
; if 1, creating of data tables and indexes with
; any extention, other than standard ( dbf,cdx,ntx )
; is enabled;
; EnableAnyExt = 0
; if 1, user authentication is necessary to
; login to the server;
; Pass_for_Login = 0
; if 1, user authentication is necessary to
; use management functions ( Leto_mggetinfo(), etc. );
; Pass_for_Manage = 0
; if 1, user authentication is necessary to
; have write access to the data;
; Pass_for_Data = 0
; the path and name of users info file;
Pass_File = d:\leto\leto_users
; if 1, the data passes to the network encrypted;
; Crypt_Traffic = 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.
Share_Tables = 1
; The number of records to read into the cache
; Cache_Records = 10
; Maximum number of shared variables
; Max_Vars_Number = 10000
; Maximim size of a text variable
; Max_Var_Size = 10000
; Global function letodb RDDI_TRIGGER
; Trigger = <cFuncName>
; Global function letodb RDDI_PENDINGTRIGGER
; PendingTrigger = <cFuncName>
; Number of tables
Tables_Max = 8000
; Number of users
; Users_Max = 500
; Debug level
Debug = 0
; if 1, SET HARDCOMMIT OFF
; Optimize = 0
; SET AUTORDER setting
; AutOrder = 0
; _SET_FORCEOPT setting
; ForceOpt = 0
[DATABASE]
Datapath=d:\projekty\_ak\
driver = CDX
packed library you can download froom my server
https://molsystemy.pl/hmg/leto.zip
Re: implement LETODB
Posted: Mon Apr 19, 2021 10:36 am
by fouednoomen
Hi Mol ,
after adding the lines of code that you showed me previously and the librddleto_20190517 library in the project, the compiler shows me this error
[image][/image]