SQL lazarus / 16-Databases ---------------------------------------------------------------------- Neville · 2024-12-27 17:03 Using TSQLQuery with Helen Borrie's SQL, The process fails at the line ending 'First'; "Operation cannot be performed on an inactive dataset." I got no complaint at the ExecSQL line. What could be the problem?    FirebirdUtilsForm.FirebirdQuery.SQL.clear;    FirebirdUtilsForm.FirebirdQuery.SQL.text := 'select rdb$relation_name,rdb$field_name,rdb$constraint_name ' +                                                'from rdb$relation_constraints rc,rdb$index_segments ri ' +                                                'where ri.rdb$index_name = rc.rdb$index_name order by rdb$relation_name';    FirebirdUtilsForm.FirebirdQuery.ExecSQL;    FirebirdUtilsForm.FirebirdQuery.First;    while not FirebirdUtilsForm.FirebirdQuery.EOF do    begin ---------------------------------------------------------------------- dsiders · 2024-12-27 17:32 Quote from: Neville on December 27, 2024, 06:03:51 pmUsing TSQLQuery with Helen Borrie's SQL, The process fails at the line ending 'First'; "Operation cannot be performed on an inactive dataset." I got no complaint at the ExecSQL line. What could be the problem?    FirebirdUtilsForm.FirebirdQuery.SQL.clear;    FirebirdUtilsForm.FirebirdQuery.SQL.text := 'select rdb$relation_name,rdb$field_name,rdb$constraint_name ' +                                                'from rdb$relation_constraints rc,rdb$index_segments ri ' +                                                'where ri.rdb$index_name = rc.rdb$index_name order by rdb$relation_name';    FirebirdUtilsForm.FirebirdQuery.ExecSQL;    FirebirdUtilsForm.FirebirdQuery.First;    while not FirebirdUtilsForm.FirebirdQuery.EOF do    begin ExecSQL is for statements that do not return a result set. https://lazarus- ccr.sourceforge.io/docs/fcl/sqldb/tcustomsqlquery.execsql.html Set Active to True to open the result set. ---------------------------------------------------------------------- Neville · 2024-12-27 19:22 Many thanks.  That works fine (of course).