LETODB

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium
Has thanked: 2 times
Been thanked: 4 times

LETODB

Post by t57042 » Sun Dec 02, 2012 10:53 am

Hello,

I am trying to test LETODB. I started from the info on this page: http://bielsys.blogspot.be/2008/07/leto ... -para.html
It is in spanish (no problem for me).
In order to compile the example program, one has to 'link RDDLeto.lib'.
This file in included in the zip download.

What is the procedure to link this lib when compiling? I am using build.bat to compile.

This may seem a stupid question, but I consider myself still a beginner with HMG.

Thanks
Richard

this is the (slightly adapted) code from the example (it is provided as a picture in the article)

Code: Select all

// letotest
#include "hmg.ch"
function main()
local cServer:='//127.0.0.1:2812/' // IPadress of server
REQUEST LETO
RDDSETDEFAULT("LETO")
if Leto_Connect(cServer)==-1 // is the server listening?
  MsgStop("No connection with server " + cServer, "Attention!" )
  return nil
else
  MsgStop("Server is listening " + cServer, "Attention!" )
endif

dbcreate(cServer + 'test1',{{'field1','N',3,0},{'field2','C',15,0},{'datum','D',8,0}})  // creating table
dbusearea(.T.,,cServer + 'test1','test1')  // open table
index on field1 TAG field1   // create index

for i=1 to 100       // create 100 records
  test1->(RLock())
  test1->(DBAppend())
  test1->field1:=i
  test1->field2:='Record '+ str(i,3)
  test1->datum:=date()
  test1->(DBUnlock())
next

test1->(DBSeek(50)) 
MsgStop(test1->field2, "Result!" )
test1->(DBCloseArea())
return nil

User avatar
esgici
Posts: 4464
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 344 times
Been thanked: 103 times
Contact:

Post by esgici » Sun Dec 02, 2012 12:22 pm

Hi Richard
t57042 wrote: What is the procedure to link this lib when compiling? I am using build.bat to compile.
Did you tried "search" or "advanced search" feature of Forum ?

Such as searching "LETODB" or "library" or more specific "LETODB + library" :?:

Surely by this way you don't have to wait responses from members ;)
This may seem a stupid question, but I consider myself still a beginner with HMG.
Again, please don't worry about that. Our friends don't care that questions are from novices or experts ;)

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D

t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium
Has thanked: 2 times
Been thanked: 4 times

Post by t57042 » Sun Dec 02, 2012 1:11 pm

I looked and do not find.

My question is more general.
How can you include any library (link it whith the program) when compiling a HMG program?

Maybe I should put my question under an other topic??

thanks
Richard

User avatar
esgici
Posts: 4464
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 344 times
Been thanked: 103 times
Contact:

Post by esgici » Sun Dec 02, 2012 2:02 pm

Hi Richard

Sadly, I haven't any experience on LetoDB ( in fact any db "server" ) :(

I guess that we have many LetoDB users in our Forum; today is weekend and most of our friends are in holiday; I hope tomorrow we will arrive to some responses.

Regarding "including library" to HMG projects subject :

As far as I know, library files with .lib extension are quite different than those have .a extension; and since HMG is MinGW based, use only the second ( .a extension ).

So you need either a MinGW compatible library or a library converter ( .lib to .a ) utility.

After having a MinGW compatible library, it's easy to include it to HMG project:
add a line to your project configuration file (.hbc) :

libs=<lib_file_name>

<lib_file_name> is name of your library file, without "lib" prefix and ".a" extension

I hope this will help you.
Maybe I should put my question under an other topic ??
No, this is right place.

Regards
Viva INTERNATIONAL HMG :D

User avatar
esgici
Posts: 4464
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 344 times
Been thanked: 103 times
Contact:

Post by esgici » Mon Dec 03, 2012 1:21 pm

Viva INTERNATIONAL HMG :D

t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium
Has thanked: 2 times
Been thanked: 4 times

Post by t57042 » Mon Dec 03, 2012 4:42 pm

Most of the problems mentioned in the links are about compiling the library.
The serverprogram and the library are already compiled in the link I gave:

http://bielsys.blogspot.be/2008/07/leto ... -para.html

The problem is that I don't know how to link the library with my source program.

regards
Richard

User avatar
savovs
Posts: 4
Joined: Mon May 03, 2010 6:38 pm
Location: Bulgaria, Levski

Post by savovs » Mon Dec 03, 2012 8:18 pm

As soon as possible I will try to do an example using letodb. For now, I'm busy. Excuse me PLEASE!

t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium
Has thanked: 2 times
Been thanked: 4 times

Post by t57042 » Mon Dec 03, 2012 8:57 pm

Thank you
Richard

User avatar
danielmaximiliano
Posts: 2087
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 114 times
Been thanked: 15 times
Contact:

Post by danielmaximiliano » Tue Dec 04, 2012 12:40 am

t57042 wrote:Most of the problems mentioned in the links are about compiling the library.
The serverprogram and the library are already compiled in the link I gave:

http://bielsys.blogspot.be/2008/07/leto ... -para.html

The problem is that I don't know how to link the library with my source program.

regards
Richard
Hola Richard :
descargue la version de Leto desde http://sourceforge.net/projects/letodb/?source=dlp, la version para Windows.
intente ejecutar Letodb.exe pero tengo el error siguiente
12/03/12 21:23:20: LetoDB service has had some problems: 1063
asi que no puedo seguir y configurar el servidor en mi Windows 7 Home Premiun, voy a intentar ver cual es el error.

esta version de Leto tiene varios ejemplos para ejecutar y probar el servidor
C:\letodb-2.09-win\tests
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
danielmaximiliano
Posts: 2087
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 114 times
Been thanked: 15 times
Contact:

Post by danielmaximiliano » Tue Dec 04, 2012 12:44 am

danielmaximiliano wrote: intente ejecutar Letodb.exe pero tengo el error siguiente
12/03/12 21:23:20: LetoDB service has had some problems: 1063
Perdón, no lei el Readme.txt que viene acompañando a Leto.
For windows service (server should be compiled with __WIN_SERVICE__ flag):

To install and uninstall service, you must have administrative privileges.
To install service, run letodb with 'install' parameter:

letodb.exe install

To uninstall service, run letodb with 'uninstall' parameter:

letodb.exe uninstall

To start and stop server, run service manager.

4. Server configuration

4.1 letodb.ini

You may provide configuration file letodb.ini if you isn't satisfied with
default parameters values. Currently following parameters exists ( default
values are designated ):

Port = 2812 - server port number;
TimeOut = -1 - connection timeout;
DataPath = - path to a data directory on a server;
Log = letodb.log - path and name of a log file;
Default_Driver = CDX - default RDD to open files on server ( CDX/NTX );
Lower_Path = 0 - if 1, convert all paths to lower case;
EnableFileFunc = 0 - if 1, using of file functions ( leto_file(),
leto_ferase(), leto_frename() is enabled;
EnableAnyExt = 0 - if 1, creating of data tables and indexes with
any extention, other than standard ( dbf,cdx,ntx )
is enabled;
Pass_for_Login = 0 - if 1, user authentication is necessary to
login to the server;
Pass_for_Manage = 0 - if 1, user authentication is necessary to
use management functions ( Leto_mggetinfo(), etc. );
Pass_for_Data = 0 - if 1, user authentication is necessary to
have write access to the data;
Pass_File = "leto_users" - the path and name of users info file;
Crypt_Traffic = 0 - if 1, the data passes to the network encrypted;
Share_Tables = 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.
Cache_Records - The number of records to read into the cache
Max_Vars_Number = 10000 - Maximum number of shared variables
Max_Var_Size = 10000 - Maximim size of a text variable
Trigger = <cFuncName> - Global function letodb RDDI_TRIGGER
PendingTrigger = <cFuncName>- Global function letodb RDDI_PENDINGTRIGGER
Tables_Max = 5000 - Number of tables
Users_Max = 500 - Number of users
Debug = 0 - Debug level
Optimize = 0 - if 1, SET HARDCOMMIT OFF
voy a intentar compilar el servidor como dice Readme.txt
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

Post Reply