[SOLVED] IBX uninitialised parameter. lazarus / 16-Databases ---------------------------------------------------------------------- iru · 2019-09-24 05:34 Gentlefolk, Environment: Linux Mint 19.2, Laz 2.02, IBX 2.3.2, Firebird 3.0..... On the open of a IBX.IBDataSet with the SelectSQL property set to 'Select A.EVENTNUM, A.EVENTGENDER, A.EVENTTYPE, ......... From E VENTDATA A where A.EVENTCOMPETITION = :EVENTCOMPETITION and A.EVENTTYPE = :EVENTTYPE order....... '; an exception occurs.    SQL Param No. 1 (EVENTTYPE) is uninitialsed. EVENTTYPE is varchar(3). All records in the table 'A' have EVENTTYPE with a non NUL value. No parameters are set on the IBX.IBDataSet. An open on IBX.IBDataSet with the SelectSQL property set to 'Select A.EVENTNUM, A.EVENTGENDER, A.EVENTTYPE,....... From EVENTDATA A where A.EVENTCOMPETITION = :EVENTCOMPETITION order.........'; works correctly with all records matching EVENTCOMPETITION displayed in a grid. Any help/ideas/suggestions appreciated, Ian. I reviewed the above and it prompted me to check some semi forgotten 'brilliant' code in the IBX.IBDataSetBeforeOpen routine. Problem solved, Ian. ---------------------------------------------------------------------- tonyw · 2019-09-24 08:56 Have you given a value to the parameter ":EVENTTYPE"? The exception suggests not. A common way to set the initial value is to do this in the dataset's "BeforeOpen" event hander. For example: procedure TForm1.MyDataSetBeforeOpen(DataSet: TDataSet); begin   (Dataset as TIBDataSet).ParamByName('EVENTTYPE').AsString := ''xxx'; end; When the select query is executed, it will then return all rows with column "EVENTTYPE" that have the value 'xxx' ---------------------------------------------------------------------- Cityalex · 2019-10-11 03:10 It would be good if we could work together on issues related to good matters. Like this again in the future