Forum > Databases

[solved] IBDynamicGrid - Parameters do not work.

(1/3) > >>

Nicole:
To my mind, there is everything ok with all parameters and syntax.
But there is a substantial error in the way I put them into events or I used them.

Let us have a closer look, there is an ibdynamicGrid_Tilgung, which is linked to a ibQuery_Tilgung.
its SQL reads,

--- Code: MySQL  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---SELECT ID_KUPON, DATUM, FK_EINKOMMEN, BETRAG, BEZEICHNUNG, BEZEICHNUNG_LANGFROM TBKUPONS a join tbeinkommenon FK_EINKOMMEN = id_einkommenwhere (betrag > :Betrag) and (Datum > :Datum)  
now the first oups awaits us:
If I activate allow active transcation the where clause works, if I deactive it there where clause works all the time no matter, if the switch is on or off.

So where is the switch:
I put it into the before_open-event and it reads (the checkbox is the switch):


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure ......IBQuery_TilgungBeforeOpen(DataSet: TDataSet);begin  IBQuery_Tilgung.ParamByName('Betrag').AsInteger:=1000;   if CheckBox_TilgungDatum.Checked  // es wird ab einem Datum geprüft (default "heute")       then IBQuery_Tilgung.ParamByName('Datum').AsDateTime:=DateTimePicker_Tilgung.Date       else IBQuery_Tilgung.ParamByName('Datum').AsDateTime:=0; // oder "alles"end;
probably the solution is easy for the one, who knows, how it works.

Zvoni:
IBQuery.Refresh?

Nicole:
There is no refresh. There is a beforeRefresh, beforePost...

I tried beforeRefresh and it did not work.

Zvoni:

--- Quote from: Nicole on August 06, 2024, 03:04:57 pm ---There is no refresh. There is a beforeRefresh, beforePost...

I tried beforeRefresh and it did not work.

--- End quote ---
Huh??
https://docwiki.embarcadero.com/Libraries/Athens/en/IBX.IBQuery.TIBQuery_Methods
I clearly see a refresh-Method....

EDIT: Might even be an idea to call "Prepare" explicitely before refreshing/opening again

Nicole:
Thank you for your answers, pls again for dummies:

My issue is, that I need to set query-paramters for an IBDynamicGrid, which is different from an DBGrid, because it allows sorting.
The trigger for activating the query is a button in my user interface.

What I tried is to go to the object inspector and guessing, which event may work.
You named "refresh" and "prepare", which I do not find in the object inspector.

Does this mean, that I have to write such events and name them like this?
And my parameters would be set there?
What about this "allow transaction" (or similar). Should it be checked or not?

Or something different?
I remember, that Tony once named an event to use. Unfortunately I can neither remember which, nor find the thread any more.

Navigation

[0] Message Index

[#] Next page

Go to full version