• Letodbf error with dbSetfilter and dbclosearea : DBUSEAREA(0) LETO erro

    From leon ravel@21:1/5 to All on Fri Jul 21 03:12:39 2023
    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()

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anderson Cardoso@21:1/5 to All on Mon Aug 7 16:09:34 2023
    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 1000
    // letodbf.log -> ERROR leto_ParseCommand()

    Hi,

    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()

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From leon ravel@21:1/5 to All on Fri Aug 18 05:38:51 2023
    Le mardi 8 août 2023 à 01:09:36 UTC+2, Anderson Cardoso a écrit :
    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 1000
    // letodbf.log -> ERROR leto_ParseCommand()
    Hi,

    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()

    Hi Anderson,
    dbSetfilter( {|| &(cfilter) } , cfilter ) didn´t work for me

    dbSetfilter() works without the 2nd parameter and the exe does not bug when opening the file again.
    dbSetfilter( {|| &cfilter } ) // ok

    Best regards
    Edmond


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)