implement LETODB

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
fouednoomen
Posts: 186
Joined: Sun Oct 14, 2012 8:33 am
DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL, Oracle, ODBC
Location: Tunisia

implement LETODB

Post 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
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: implement LETODB

Post by mol »

I'm using letodbf by Elch.
Works very good.
I'll try to write tomorrow
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: implement LETODB

Post by luisvasquezcl »

Hola Mol, es posible que puedas compartir ese conocimiento?. Gracias
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: implement LETODB

Post 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.
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
User avatar
salamandra
Posts: 311
Joined: Thu Jul 31, 2008 8:33 pm
DBs Used: DBF, MySQL, SQL
Location: Brazil

Re: implement LETODB

Post by salamandra »

Hi Mol,

+1


Salamandra, Brazil
There is one time in which is crucial awakening. That time is now. ( Buddha )
jorge.posadas
Posts: 172
Joined: Mon May 19, 2014 7:43 pm
DBs Used: DBF, SQLite, MS-SQL, ACCESS, MariaDB (en proceso)
Location: Morelia, Mich. México
Contact:

Re: implement LETODB

Post by jorge.posadas »

Mol.

I am also interested in using letobe
Cordialmente

POSADAS SOFTWARE
Jorge Posadas Ch.
Programador independiente
Morelia, Mich.
M é x i c o .
Movil +52 44 3734 1858
SKYPE: jorge.posadasch
Email: posoft@gmx.com
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: implement LETODB

Post 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
User avatar
fouednoomen
Posts: 186
Joined: Sun Oct 14, 2012 8:33 am
DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL, Oracle, ODBC
Location: Tunisia

Re: implement LETODB

Post 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
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: implement LETODB

Post by mol »

I can pass compiled library and server service
you can install letodb as a service:

Code: Select all

letodbsvd.exe install
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
User avatar
fouednoomen
Posts: 186
Joined: Sun Oct 14, 2012 8:33 am
DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL, Oracle, ODBC
Location: Tunisia

Re: implement LETODB

Post 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]
Attachments
eror.jpg
eror.jpg (261.78 KiB) Viewed 5415 times
Post Reply