Hi,
using harbour lastest version and Letodbf lastest version, with the use of a filter, dbUsearea generates an error before opening the file again witout using dbclearfilter() before dbclosearea().
Best regards,
Edmond
private Mydbf:="//127.0.0.1:2812/\Testdbf.dbf"
private cfilter:='FIELD1="ABC"'
dbCreate( Mydbf , { {"FIELD1","C",3,0} } , "LETO" )
dbUsearea( .F. , "LETO" , Mydbf , NIL , .T. , .F. )
dbSetfilter( &( "{|| "+cfilter+" }" ) , cfilter ) // or dbSetfilter( {|| &cfilter } , cfilter )
// bug without dbclearfilter()
dbclosearea()
// -> error += DBUSEAREA(0) LETO error = 21: EG_OPEN No 1000
// letodbf.log -> ERROR leto_ParseCommand()
Em sexta-feira, 21 de julho de 2023 às 07:12:40 UTC-3, leon ravel escreveu:
Hi,
using harbour lastest version and Letodbf lastest version, with the use of a filter, dbUsearea generates an error before opening the file again witout using dbclearfilter() before dbclosearea().
Best regards,
Edmond
private Mydbf:="//127.0.0.1:2812/\Testdbf.dbf"
private cfilter:='FIELD1="ABC"'
dbCreate( Mydbf , { {"FIELD1","C",3,0} } , "LETO" )
dbUsearea( .F. , "LETO" , Mydbf , NIL , .T. , .F. )
dbSetfilter( &( "{|| "+cfilter+" }" ) , cfilter ) // or dbSetfilter( {|| &cfilter } , cfilter )
// bug without dbclearfilter()
dbclosearea()
// -> error += DBUSEAREA(0) LETO error = 21: EG_OPEN No 1000Hi,
// letodbf.log -> ERROR leto_ParseCommand()
Didn´t work for me too but I made some changes for you and this code below works:
// servidor LETODBf
#include "rddleto.ch" // defines do RDD
#include "dbinfo.ch" // Header file for the RDD API Index OrderInfo and DBInfo support
#include "leto_std.ch" // traduz os comandos para o LETO
#define __LETO_TRANSLATE_FILE_ALL
#include "letofile.ch" // traduz todas as funções para o LETO
REQUEST RDDLETO
REQUEST RDDInfo
FUNCTION MAIN()
private Mydbf:="//127.0.0.1:2812/"
private cfilter:='FIELD1="ABC"'
setmode(25,80)
*****************************************************
*** DEFINIR TIPO DE BANCO DE DADOS PADRÃO: DBFCDX *** *****************************************************
ANNOUNCE RDDSYS
REQUEST DBFCDX
ANNOUNCE FPTCDX
REQUEST DBFFPT
Request ordfor
**********************************
*** CODEPAGE E CHARSET
**********************************
REQUEST HB_LANG_PT
REQUEST HB_CODEPAGE_PT850
***************************************************
*** CONFIGURAÇÃO DO BANCO DE DADOS PADRÃO ********* ***************************************************
RDDSETDEFAULT("DBFCDX")
RDDREGISTER( "DBFCDX", 1 ) // RDT_FULL
SET AUTOPEN OFF
SET OPTIMIZE ON
SET HARDCOMMIT OFF
SET DELETED ON
RDDSETDEFAULT( "LETO" )
IF leto_Connect( Mydbf ) == -1
ALERT("Nenhum LetoDBF Server encontrado - Erro: " + leto_Connect_Err( .T. ) )
QUIT
ELSE
? "LETODBF DATABASE MANAGER running"
ENDIF
? "Press ALT+D and read line by line with debug to see it working. Type F6 to see opened DBFs."
INKEY(0)
dbCreate( "mydbf" , { {"FIELD1","C",3,0} } )
dbUsearea( .F. ,, "mydbf" ,,, .T. , .F. )
dbSetfilter( {|| &(cfilter) } , cfilter ) // or dbSetfilter( &( "{|| "+cfilter+" }" ) , cfilter )
dbclosearea()
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 374 |
Nodes: | 16 (2 / 14) |
Uptime: | 113:31:49 |
Calls: | 7,951 |
Calls today: | 2 |
Files: | 13,008 |
Messages: | 5,811,331 |