Thank you for the hint.
I will try it, may be you have a second hint for me?
Nicole,
it may be that the point that you are missing is that (as a design choice) IBX always clears query parameter values when a dataset is closed. It is thus OK to do something like this:
MyDataset.ParamByName('foobar').AsInteger := ...
MyDataset.Active := true;
but only if you do not close "MyDataset" until the form closes. If you close and re-open "MyDataset" without updating the query parameters then you get an error.
A datasets may be closed and re-opened for several reasons:
1. You have done this explicitly in your program.
2. It is the "Detail" dataset in a "Master/Detail" relationship, and the Master dataset is scrolled.
3. A dynamic control (e.g. IBDynamicGrid) changes its view on the data (e.g. by clicking on a column header).
The way to ensure that query parameters are always set every time a dataset is opened is to set each parameter in the Dataset's BeforeOpen eventhandler. This works because this event handler is always called when a dataset is opened or re-opened and immediately before the select query is executed.
It is hard to work with it.
At the moment there is a topic let us say ListCustomers. I generate a SQL-thing e.g. IBSQL_ListCustomers and a button, e.g. button_ListCustomers. In the click-event there I wirte the SQL-code and fill in the parameters.
If the sql-text is in the edit field and the parameters in an event, it needs a lot of clicks more to find out, what belongs to which.
Or is my style here poor as well?
I never learnt programming. I am a lonely girl and learnt what I need to perform a certain task.
You don't need to follow a prescribed course in order to be a successful programmer. The only course I have ever been on was in 1975 when I did a two week introductory course on AlgolW (the precursor to Pascal) in between the first year exams of my Maths degree and getting the results. What I really learnt from that course was that I liked programming and went on to have (I believe successful) career in the IT industry over the next five decades