LetoDBF

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
mol
Posts: 3073
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 180 times
Been thanked: 96 times
Contact:

LetoDBF

Post by mol » Thu Mar 29, 2018 6:01 pm

Hi guys!
Do you have any experience with LetoDBF?

User avatar
serge_girard
Posts: 2166
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 472 times
Been thanked: 108 times
Contact:

Post by serge_girard » Thu Mar 29, 2018 8:21 pm

No, not yet!

Serge

User avatar
mol
Posts: 3073
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 180 times
Been thanked: 96 times
Contact:

Post by mol » Thu Mar 29, 2018 8:51 pm

I still have no time to study this :-(

trmpluym
Posts: 230
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands
Has thanked: 6 times
Been thanked: 19 times

Post by trmpluym » Thu Mar 29, 2018 9:09 pm

Yes, what do you want to know ?

User avatar
mol
Posts: 3073
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 180 times
Been thanked: 96 times
Contact:

Post by mol » Fri Mar 30, 2018 4:59 pm

How to start to use it.

trmpluym
Posts: 230
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands
Has thanked: 6 times
Been thanked: 19 times

Post by trmpluym » Sat Mar 31, 2018 1:43 am

Mol,

Here a a quick start:

Download the sources and the binaries from:

http://www.kresin.ru/en/letodb.html

Put letodb.exe and letodb.ini in a folder and Install the service by opening an elevated CMD prompt and type:

letodb.exe install

Start the LetoDb service ( start -> run -> services.msc )

LetoDb uses TCP port 2812 by default. If you want to connect the LetoDB server from a remote computer, open the TCP port 2812 in the firewall for incoming traffic. If you prefer another TCP port you can edit the letodb.ini file.

Copy the source files in a folder ( for example c:\hmg.3.4.4\letodb )

Build the library with the batch file below:

Code: Select all

@echo off
SET HMGPATH=\hmg.3.4.4
SET PATH=%HMGPATH%\harbour\bin;%HMGPATH%\mingw\bin;%PATH%
hbmk2 leto.hbp -i%hmgpath%\include -iinc
hbmk2 rddleto.hbp -i%hmgpath%\include -iinc
copy c:\hmg.3.4.4\letodb\lib\libleto.a c:\hmg.3.4.4\lib\libleto.a
copy c:\hmg.3.4.4\letodb\lib\librddleto.a c:\hmg.3.4.4\lib\librddleto.a
pause
Using LetoDB in your PRG is simple:

The DBF files need to be placed in the folder of LetoDb.exe (or change the path in LetoDb.ini).

Here some code using an existing database TEST.DBF:

Code: Select all

cLetoServerPath="//192.168.1.1:2812/"     // 192.168.1.1 is the IP of the pc running the service, 2812 is the default LetoDB TCP/IP port
REQUEST LETO  
RDDSETDEFAULT( "LETO" )
USE ( cLetoServerPath+"Test" ) New Shared INDEX ( cLetoServerPath+"Test" ) VIA "LETO"
Keep in mind to include the libraries in your .hbc file when compiling, by adding the lines:

libs=rddleto
libs=leto

You can keep the rest of your PRG almost 100% the same !

User avatar
mol
Posts: 3073
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 180 times
Been thanked: 96 times
Contact:

Post by mol » Sat Mar 31, 2018 6:24 am

Wow!
It looks amazing!
Last problems with Samba protocol cause to search different solution.
I've rebuild one of my apps with netio, but it requires a lot of changes in sources.

User avatar
mol
Posts: 3073
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 180 times
Been thanked: 96 times
Contact:

Post by mol » Tue Apr 03, 2018 7:05 pm

With view changes in my application it looks really great!
I'm testing with W7Prof as server and W10Pro as client.
Speed does not difference as using shared folders and SAMBA protocol.
I'll try to invert client and server.

User avatar
mol
Posts: 3073
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 180 times
Been thanked: 96 times
Contact:

Post by mol » Wed Apr 04, 2018 1:29 pm

There is a bug in LetoDB by Kresin.
When I open few indexes to one table in one instance of application, second application can not open these indexes - no errors, but it's always opened last.
Eg.
Table client
index files:
client1 order ClientId
client2 order ClientName
client3 order TaxId

on first instance:
IndexKey(1) returns "ClientId"
IndexKey(2) returns "ClientName"
IndexKey(3) returns "TaxId"

on first instance:
IndexKey(1) returns "TaxId"
IndexKey(2) returns "TaxId"
IndexKey(3) returns "TaxId"


Has anybody any idea what's going on?

User avatar
serge_girard
Posts: 2166
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 472 times
Been thanked: 108 times
Contact:

Post by serge_girard » Wed Apr 04, 2018 1:33 pm

No, not yet into LetoDB... !

Serge

Post Reply