tdatabase Filter error

Re: tdatabase Filter error

Postby nageswaragunupudi » Thu May 02, 2019 4:06 pm

Yes
Yes
For clearing filter, it is easier and better to use oDbf:SetFilter( "" )
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: tdatabase Filter error

Postby Silvio.Falconi » Thu May 02, 2019 5:35 pm

thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7055
Joined: Thu Oct 18, 2012 7:17 pm

Re: tdatabase Filter error

Postby Silvio.Falconi » Fri May 03, 2019 5:22 pm

this evening the app make an error
Code: Select all  Expand view
Application
===========
   Path and name: C:\Work\Prg\Bikini_scuola\Bikini\main.Exe (32 bits)
   Size: 5,052,928 bytes
   Compiler version: Harbour 3.2.0dev (r1703231115)
   FiveWin  version: FWH 19.03
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.2, Build 9200

   Time from start: 0 hours 0 mins 10 secs
   Error occurred at: 03-05-2019, 19:17:51
   Error description: Error BASE/1074  Argument error: <=
   Args:
     [   1] = U  
     [   2] = D   26-07-2018

Stack Calls
===========
   Called from:  => (b)EVAL( 719 )
   Called from:  => DBGOTOP( 0 )
   Called from: .\source\classes\DATABASE.PRG => (b)TDATABASE( 189 )
   Called from: .\source\classes\DATABASE.PRG => TDATABASE:GOTOP( 0 )
   Called from: source\PSpiaggia.prg => CHANGE_PLAN( 722 )
   Called from: source\PSpiaggia.prg => (b)BEACH( 217 )
   Called from: .\source\classes\DIALOG.PRG => TFSDI:INITIATE( 864 )
   Called from: .\source\classes\DIALOG.PRG => TFSDI:ACTIVATE( 330 )
   Called from: source\PSpiaggia.prg => BEACH( 217 )
   Called from: source\main.prg => (b)TAPPLICATION_NEW( 313 )
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1064 )
   Called from: source\main.prg => TAPPLICATION:ACTIVATE( 364 )
   Called from: source\main.prg => MAIN( 76 )



On Function Change_Plan(dDataIniziale,dDataFinale,lshowNumeri)

I Made
Code: Select all  Expand view


oReservation:setorder(1)
    oReservation:Exec( < ||
    SET FILTER TO AllTrim( FIELD->TYPE ) == AllTrim( cTypeRoom ) .and. FIELD->NUM = nElemento ;
   .AND. ( dDataIniziale <= FIELD->CHECK_OUT .AND. dDataFinale >= FIELD->CHECK_IN )
   return nil
   > )
   oReservation:gotop()
 


the dbf is index on INDEX ON ROOMS_ID + DToS(CHECK_IN )
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7055
Joined: Thu Oct 18, 2012 7:17 pm

Re: tdatabase Filter error

Postby nageswaragunupudi » Fri May 03, 2019 5:45 pm

most likely the value of dDataIniziale is nil.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: tdatabase Filter error

Postby Silvio.Falconi » Fri May 03, 2019 7:01 pm

no

this is only for test

static dDataIniziale,dDataFinale,lshowNumeri

on function Beach()

//only for test
oApp:dDataIniziale := ctod("01-07-2018")
oApp:dDataFinale := ctod("07-08-2018")
oApp:lshowNumeri:= .t.


on Function Change_Plan


oReservation:setorder(1)
oReservation:Exec( < ||
SET FILTER TO AllTrim( FIELD->TYPE ) = AllTrim( cTypeRoom ) .and. FIELD->NUM = nElemento ;
.AND. ( oApp:dDataIniziale <= FIELD->CHECK_OUT .AND. oApp:dDataFinale >= FIELD->CHECK_IN )
return nil
> )
oReservation:gotop()





but on application the date is set to date() on Main.prg

::dDataIniziale := date()
::dDataFinale := date()
::lShowNumeri := .t.

before to load the ribbonbar
::BuildRibbonbar()



and the on RibbonBar there are two datepick to select the date

Code: Select all  Expand view
@ 0.9,12  DTPICKER  oDate1 VAR  oApp:dDataIniziale  OF   oGr1   SIZE 145,25  VALID oApp:dDataIniziale<=oApp:dDataFinale  UPDATE picture "ddd dd mmm yyyy" FONT oFontBig
    @ 0.9,40  DTPICKER  oDate2 VAR  oApp:dDataFinale  OF   oGr1  SIZE 145,25    VALID oApp:dDataIniziale<=oApp:dDataFinale  UPDATE picture "ddd dd mmm yyyy"  FONT oFontBig
 



and a button with a menu sample :

Code: Select all  Expand view
MENUITEM "Today"  ACTION ( oApp:dDataIniziale  :=date(),oApp:dDataFinale    :=date(),oDate1:refresh(),oDate2:refresh(),CHANGE_PLAN( oApp:dDataIniziale,oApp:dDataFinale,oApp:lShowNumeri))



and the user can select the Interval of date()

as you see on this picture


Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7055
Joined: Thu Oct 18, 2012 7:17 pm

Re: tdatabase Filter error

Postby Silvio.Falconi » Fri May 03, 2019 7:55 pm

I change something ....
now ddatainiziale and ddatafinale are a data of class Tapplication where is the ribbonbar and as you can see seem run ok

Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7055
Joined: Thu Oct 18, 2012 7:17 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Marc Venken, Silvio.Falconi and 132 guests