LetoDBF

478 views
Skip to first unread message

Francisco Mauricio

unread,
Nov 19, 2023, 6:48:33 AM11/19/23
to Harbour Users

Hello,

 

I’m starting with LETODBf. I install service, change, in letodb.ino, change DataPath to a folder with my *.dbf files, but in “manage.exe” after connection I receive the information Table 0, I have no tables.

Can anyone help ?

cod...@outlook.com

unread,
Nov 19, 2023, 7:40:22 AM11/19/23
to Harbour Users
I use LetoDBf fork created by user elch (Rolf). I do not use LetoDB. 
It is very reliable product.
It is pity that Rolf no more participates in this forum.
Can we see letodb.ini content. Can you explain what is manage.exe. If it is your PRG where you open LetoDBF connection, can we see that code.  It will be helpful to explain folder structure of your application, where is letodb.ini. leotodb.exe and where are *.DBF files.

Regards,
Simo. 

Francisco Mauricio

unread,
Nov 19, 2023, 7:49:39 AM11/19/23
to harbou...@googlegroups.com
Hello Simo,


This is my letodb.ini


Server = LOCALHOST
IP = 127.0.0.1
Port = 2812
DataPath = C:/Trab/LetoDBf/SERVER/DATA
;/mnt/sun/PRO-CNC/DATEN
LogPath = C:/Trab/LetoDBf/SERVER
Default_Driver = NTX
;Lock_Scheme = 6
;Memo_Type = FPT
Share_Tables = 1
No_Save_WA = 1
Lower_Path = 0
EnableFileFunc = 1
EnableAnyExt = 1
Allow_UDF = 1
Pass_for_Login = 0
Pass_for_Manage = 0
Pass_for_Data = 0
;Pass_File = leto_users
Cache_Records = 21
Max_Vars_Number = 1000
Max_Var_Size = 67108864
;Tables_Max  = 999
;Users_Max = 99
Debug = 1
Optimize = 1
;AutOrder = 0
;ForceOpt = 0
;TimeOut = 360
;Zombie_Check = 0
;Server_User = advantage
;Server_UID = 1000
;Server_GID = 4
;BC_Services = letodb;
;BC_Interface = eth2
;BC_Port = 2812
;SMB_SERVER = 1
DataBase = C:/Trab/LetoDBf/SERVER/DATA
;Backup = /tmp/backup
Mask = *.dbf,*.dbt,*.ntx
Lock = 1
Seconds = 30
Wait = 1
;ArcCmd = tar -cvzf /tmp/backup/leto.tar.gz /tmp/backup/*

Manage.exe is a "server management Utility"  is included in the package
image.png

Thanks for your help

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/b66a4966-3931-4d8f-9c0f-31f31aef3fddn%40googlegroups.com.


--

_____________
Francisco Mauricio

cod...@outlook.com

unread,
Nov 19, 2023, 9:00:15 AM11/19/23
to Harbour Users
To be honest I never used any "manage.exe". I am little confused, I did not realized that manage.exe exists at all in LetoDBf. I know that it exists in LetoDB but not in LetoDBf. Sorry, My fault. 

I can send you my letodb.ini:

Server =
IP =
Port = 2812
DataPath = D:/LETOROOT/
;LogPath = /tmp

Default_Driver = NTX
;Lock_Scheme = 6
;Memo_Type = FPT
Share_Tables = 0

No_Save_WA = 1
Lower_Path = 0
EnableFileFunc = 1
EnableAnyExt = 1
Allow_UDF = 1
Pass_for_Login = 0
Pass_for_Manage = 0
Pass_for_Data = 0
;Pass_File = leto_users
Cache_Records = 100
;Max_Vars_Number = 1000
;Max_Var_Size = 67108864
Tables_Max  = 10000
Users_Max = 99
Debug = 0

Optimize = 1
;AutOrder = 0
;ForceOpt = 0
TimeOut = 40

;Zombie_Check = 0
;Server_User = advantage
;Server_UID = 1000
;Server_GID = 4
;BC_Services = letodb;
;BC_Interface = eth2
;BC_Port = 2812
;SMB_SERVER = 1
DataBase = /

Backup = /tmp/backup
Mask = *.dbf,*.dbt,*.ntx
Lock = 1
Seconds = 30
Wait = 1
ArcCmd = tar -cvzf /tmp/backup/leto.tar.gz /tmp/backup/*

As you can see I have one root folder named LETOROOT. Below it I can have some *.DBF or several subfolders which  contains other *.DBF files. In LETOROOT are my letodb.ini and letodb.exe.

I think it is better for you to write some PRG where you open connection and open one of your DBF. In that way you will see how to work with LetoDBf.

I am sending you some part of my PRG where I open LetoDBf connection:
 
IF param4()=="LETO"  //  in this way I can use LetoDBf or app can work without LetoDBf 
   cConn:="//"+ulparam2+"/"                   //  making  "//192.168.0.16:2812/"  IP address and port
   cPath:=ulparam3  //  in my app it can be used as  working subfolder. In this example I do not use this parameter as I have all needed DBFs just below LETOROOT
                // but if you want to have some subfolders below LETOROOT this parameter can help you , but it is up to you
   *
   RDDSETDEFAULT("LETO")
   IF LETO_CONNECT(cConn) == -1
      Msg("No connection with LETO server !",,1)
      CLOSE DATABASES
      RETURN NIL
   ELSE
      Msg("Connection succeesef, continue ...",,1,1)
   ENDIF
ENDIF
*

To explain:
I have leto23.bat file with next content:

\rasexe\RAS00 "B" "192.168.100.2" "RAS23\" "LETO"

To start app I start leto23.bat. This is \rasexe\RAS00 path where is my RAS00.EXE. "B" is some parameter not interested for us.  "192.168.100.2"  is IP address of computer where is LetoDBF is started as service (ulparam2). "RAS23\"  is name of subfolder in LETOROOT in which are some other *.DBF (ulparam3).  "LETO"  id fourth parameter which tells me will I use LetoDBF or not. In this way same app can work in LetoDBf and in no-LetoDBf  environment.

Next, If connection succeeded  I can open any DBF just below LETOROOT or in subfolder RAS23, in usual way. 


Regards,
Simo.

Francisco Mauricio

unread,
Nov 19, 2023, 10:04:59 AM11/19/23
to harbou...@googlegroups.com
Hello Simo,

Thank you again, i will try your suggestions, and I will keep you informed.

Regards
Francisco Mauricio  

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.


--

_____________
Francisco Mauricio

Francisco Mauricio

unread,
Nov 19, 2023, 12:08:32 PM11/19/23
to harbou...@googlegroups.com

Hello again Simo,

 

I have following parameters in letodb.ini

Server = LOCALHOST

IP = 127.0.0.1

Port = 2812

DataPath = C:/Trab/LetoDBf/SERVER/DATA

 

 

I put may file fich.dbf in this folder  ( C:/Trab/LetoDBf/SERVER/DATA )

When I try to open it using command

DBUSEAREA( ,, 'fich', 'FIL')

Have following error

image.png



Can you help ?


--

_____________
Francisco Mauricio

cod...@outlook.com

unread,
Nov 19, 2023, 12:37:43 PM11/19/23
to Harbour Users

Hi  Francisco Mauricio

I suppose you have ona small test PRG.
Can you send me that PRG where you open file fich.dbf. I must see how you open connection to LetoDBf and some other things.
Then I will try same PRG on my place, making directories as you have.

Meanwhile, try this:
1-In your letodb.ini, in parameter    DataPath = C:/Trab/LetoDBf/SERVER/DATA  I have closing slash, so try with  DataPath = C:/Trab/LetoDBf/SERVER/DATA/  
2-In your letodb.ini you have parameters
Server = LOCALHOST
IP = 127.0.0.1
but in my letodb.ini these parameters are empty
Server =
IP =
No need for them. You will use IP address in PRG where open connection to LetoDBf.
3-Check that you have  letodb.ini and letodb.exe in folder  DataPath = C:/Trab/LetoDBf/SERVER/DATA

Regards,
Simo.

Francisco Mauricio

unread,
Nov 19, 2023, 2:00:04 PM11/19/23
to harbou...@googlegroups.com
Hi Simo,

This is the code that I use to connect
cPath := "//127.0.0.1:2812/"
cDBFUSER := ""
    cDBFPASS := ""

nHotbuf := 100
nTimeOut := 6000

 
IF leto_Connect( cPath, cDBFUSER, cDBFPASS, nTimeOut, nHotBuf) < 0
         MsgStop(' Erro', 'LetoDBf')
         RETURN
   ELSE

         cLetoVer := LETO_GetServerVersion()
msgbox(cLetoVer)
         leto_Disconnect()
   ENDIF


This is the  folder


image.png



This is error

image.png


Thanks for your help in advance

Francisco Mauricio

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.


--

_____________
Francisco Mauricio

cod...@outlook.com

unread,
Nov 19, 2023, 3:17:58 PM11/19/23
to Harbour Users
 Hi Francisco Mauricio 

Meanwhile I have created folder  C:/Trab/LetoDBf/SERVER/DATA  on my place.
In that folder I put my letodb.exe and my letodb.ini.
Also in that folder I put Test.Dbf file. 

In letodb.ini I have next part:
Server =
IP =
Port = 2812
DataPath = C:/Trab/LetoDBf/SERVER/DATA/

;LogPath = /tmp
Default_Driver = NTX

Then I started letodb.exe as service with      letodb.exe install
(must use administrative rights !)
In letodbf.log I can see that server is started.

After that in some other folder, say C:\TrabPrg,  I created next small test PRG:

*
FUNCTION Test (ulparam1,ulparam2,ulparam3,ulparam4)
*
LOCAL cConn,cPath,xcime
*
IF ! EMPTY(PCOUNT())
   ulparam1:=UPPER(ulparam1)  // B-u boji, M-mono, prazno-onako kakav je monitor
   IF ulparam2 != NIL
      ulparam2:=UPPER(ulparam2)  // IP adresa i PORT
   ENDIF
   IF ulparam3 != NIL
      ulparam3:=UPPER(ulparam3)   
   ENDIF
   IF ulparam4 != NIL
      ulparam4:=UPPER(ulparam4)  // use LETO or no  ...
   ENDIF
ELSE
   ulparam1:=NIL
   ulparam2:=NIL
   ulparam3:=NIL
   ulparam4:=NIL
ENDIF
*
IF ulparam4=="LETO"

   cConn:="//"+ulparam2+"/"
   cPath:=ulparam3  //  at this moment I do not use this param !

?"ulparam1=",ulparam1
?"ulparam2=",ulparam2
?"ulparam3=",ulparam3
?"ulparam4=",ulparam4
?"cConn",cConn
?"cPath",cPath
wait


   *
   RDDSETDEFAULT("LETO")
   IF LETO_CONNECT(cConn) == -1
      ?"No connection with LETO server !"

      CLOSE DATABASES
      RETURN NIL
   ELSE
      ?"Connection OK !"
   ENDIF
ENDIF
*
xcime:="OSSODE"  // this is file name (OSSODE.DBF)
USE (xcime) NEW SHARED
?"LASTREC",lastrec()

*
RETURN NIL
*
*EOP---------------------------------------Test--------------------------
*

Compiled this PRG with no errors.

In same folder C:\TrabPrg  I created leto1.bat:
TEST00 "B" "192.168.100.2" "FLD23\" "LETO" 

Finally on command line I type  leto1.bat and press Enter. My PRG works fine !

I forget to say that I work with Harbour 3.2.0dev (r1904111533).

You can see that your PRG can be in other folder then folder with data   C:/Trab/LetoDBf/SERVER/DATA. 
May be that your letodb.exe or your letodb.ini makes you problems. Or you did not corretly compiled your test program.
If you need I can write what I have in  hbmk.hbm  file when compiling Test.prg. 

Hope this helps.


Regards,
Simo.

Francisco Mauricio

unread,
Nov 19, 2023, 3:54:16 PM11/19/23
to harbou...@googlegroups.com
Hello Simo,

Can you send me your  hbmk.hbm.

Send it directly to my mail

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.


--

_____________
Francisco Mauricio

hherrera

unread,
Nov 29, 2023, 9:11:47 AM11/29/23
to Harbour Users

Hi my friends!!

were you able to solve the problem?
I recommend that you watch Minigui extended
C:\MiniGUI\SAMPLES\Advanced\LetoDBf
There you find an example with the updated leto libraries and server

add check this lines

     REQUEST LETO
     RDDSETDEFAULT( "LETO" )

hherrera

unread,
Nov 29, 2023, 9:18:56 AM11/29/23
to Harbour Users

I send my function

FUNCTION fLetoDB_Conect(cString)
// OJO: Funcion propia de Leto, para intentar conectarse con el servidor.  Ambos IP y Puerto deben ser los mismos que se asignaron en el servidor
IF leto_Connect( cString ) # 0    
  RETURN( { LETO_CONNECT_ERR()    ,;            // Devuelve un numero de error
            LETO_CONNECT_ERR(.T.) ,;                    // Cadena de error
            "",;                                                                 // Ip y Puerto no valido, devuelve cadena vacia
            "" } )                                                             // No se conecto, no hay Version de Leto
ELSE
  RETURN( { 00,;                                                    // no error
            "",;                                                                 // Cadena exitosa, no devuelve error
            cString,;                                                      // Devuelve Ip y Puerto  valido
            LETO_GetServerVersion()} )                   // Version de LetoDBF  
  leto_Disconnect()
ENDIF
RETURN

FUNCTION fLetoDB_ConfigPort(cPath,cPort)                   // Configura el String y el Puerto
if cPath = nil
  cPath:= "127.0.0.1"
endif

cPath:= ALLTRIM(cPath)
IF cPort = nil .AND. AT(":", cPath) = 00                  // Asignamos el puerto si no se envio
  cPath+= ":2812"
ENDIF
IF cPort # nil .AND. AT(":", cPath) = 00
  cPath+= ":"+ cPort
ENDIF
cString:= cPath
RETURN(cString)
*-------------------------------------------------------------------------------

FUNCTION  MyRddIsLeto()
if RddSetDefault() ="LETO"
  RETURN(.t.)
endif
return(.f.)
Message has been deleted
Message has been deleted
Message has been deleted

hherrera

unread,
Nov 29, 2023, 9:37:29 AM11/29/23
to Harbour Users
I attach a small binary that I made, solely to test that the terminals have a connection with leto.
https://www.mediafire.com/file/gec2h1klma8c0rx/LetoDBF-ClienteMonitor.rar/file I use LETODB, the server.exe is the one that comes with minigui

Reply all
Reply to author
Forward
0 new messages