working with a dataset from other form? lazarus / 16-Databases ---------------------------------------------------------------------- tatamata · 2007-09-02 07:25 Hello. I have a Firebird database and want to use it as embedded database with Lazarus. As in embedded case there can't be several simultaneous connections to the database, obviously I must put connection component to the main form and use it from other forms. I put also all dataset components to the main form, while datasource components put on the secondary forms. Before opening some other form with for example datagrids, I set Dataset property of the Datasource component programatically from the main form, and it works. Main form has other form's units in it's Uses part. But, what to do when I need to programatically access dataset object in the main form, from other forms? I can't put main form's unit in the uses of the secondary form, because circular reference is not allowed. Therefore I tried to use Dataset property of the datasource in order to reach dataset in the main form. But it doesn't accept some properties of the Dataset. For example, this works: with Datasource1.Dataset do begin     Active:=True;   but this doesn't: with DatasourceDestinationTable.Dataset do begin     TableName:='TBL1';     Active:=True; end; It doesn't accept TableName property ofthe dataset object from the main form. Also, I can't assign new sql string to ZQuery component in the main form:   with DatasourceZQueryTemp.DataSet.SQL do begin     Clear;     Add('DELETE FROM TBL1');     ExecSQL;   end; So, how to access and work with datasets of the main form, from a secondary form? Regards, Zlatko ---------------------------------------------------------------------- tatamata · 2007-09-13 12:59 Ok. I will answer to myself. While crossreferencing of units is not allowed in interface part, it is allowed in implementation part.