FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with Filter and Tdatabase
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Problem with Filter and Tdatabase
Posted: Wed Nov 06, 2024 12:38 PM
Please I have this function
Code (fw): Select all Collapse
#include "fivewin.ch"

request dbfcdx

Function test 
     local oDbf
     local cdbfPath:= cFilePath(GetModuleFileName( GetInstance() ))  + "Data\"
     local nYear:= year(date())
     local   cFilter:= "LTRIM(STR(YEAR(FIELD->DATA)))= '" + ltrim(str(nyear)) + "'"
   

  oDbf:= TDatabase():Open( , cdbfPath+"LOTTO", "DBFCDX", .T. )
  oDbf:setorder(1)
  oDbf:GoTop()

          xbrowser odbf

        oDbf:SetFilter(cFilter)
        oDbf:GoTop()

     xbrowser odbf
return nil
the index 1 is on DTOS(DATA)+CONCORSO

before the filter I see all archive



the filter seems good



After the filter it not show any records , why ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Problem with Filter and Tdatabase
Posted: Wed Nov 06, 2024 01:25 PM

Silvio,

have you some records in which the year of field named "data" is 2024

In the screenshot I see 1971

Bye

Marco Boschi
info@marcoboschi.it
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with Filter and Tdatabase
Posted: Wed Nov 06, 2024 01:29 PM
MarcoBoschi wrote:Silvio,
have you some records in which the year of field named "data" is 2024
In the screenshot I see 1971

Bye
yes that is the beginning of the archive, I tried to make a filter in emagdbu


Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with Filter and Tdatabase
Posted: Wed Nov 06, 2024 08:42 PM
It's strange because in the test I did, that is, in the procedure in a small dialog, everything works perfectly, but when I create an object class with all the functions of the procedure it doesn't work, that is, it doesn't find the data, there's definitely an error somewhere that I can't find.

this is basically what i'm doing, it seems complex but it's not

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion