Page 1 of 1

RaiseForwardOnlyException in AbstractResultSet

Posted: 09.03.2016, 12:03
by louis
Hallo,
I need a TStoredProc with a property "DataSource" published because I have a framework that use this property to gain MasterTable in TDataModule.

Because TStoredProc not provide property "DataSource" I derived a new component TmxZStoredProc with only add property "DataSet" like this:

Code: Select all

type
  TmxZStoredProc = class(TZStoredProc)
  published
    { Published declarations }
    property DataSource;
  end;
If I connect the property "DataSource" of this new component to a ZReadOnlyDataset or derived when I go Next or previous record, and mxZStoredProc is Active, is raised the ForwardOnly Exception in row 731 of ZDbcResultSet.pas.

There is a possibility to avoid this?

I compiled with revision TRUNK 7.2.0.3882

Thanks

Re: RaiseForwardOnlyException in AbstractResultSet

Posted: 09.03.2016, 15:48
by marsupilami
Hello louis,

which database do you use (Firebird, PostgreSQL, Sybase, sqlite, ...) and which version of that database? I am not si used to using the DataSource Property but if I understand it correctly it is meant to be used in a master-slave scenario. Does the TZStordProc already provide the necessary fields for the synchronization that is necessary?

With best regards,

Jan

Re: RaiseForwardOnlyException in AbstractResultSet

Posted: 09.03.2016, 17:23
by louis
marsupilami wrote:which database do you use (Firebird, PostgreSQL, Sybase, sqlite, ...) and which version of that database?
Database is Firebird, version is 2.5.5.
I am not si used to using the DataSource Property
I need to use "Datasource" property because I need to retrieve the Master-Dataset in a scenario Master-Detail. I used ZStoredProc to show a lot of detail rows because with a query is not possible obtain a particular sum (progressive sum) of a fields.
Does the TZStordProc already provide the necessary fields for the synchronization that is necessary?
I don't know that, I see that the ancestor of TZStoredProc is TZAbstractDataset but I don't know enough. I only exposed "DataSource" property and I use it in a recoursive function to get the main Master-DataSet of DataModule via DBAction for display purpose.

Thanks.

Re: RaiseForwardOnlyException in AbstractResultSet

Posted: 10.03.2016, 11:59
by louis
Hello,
ok, I am a novice in FB and I will understand it :)

I discovered that I can do a "select * from MyStoredProc" within the property SQL of a ZReadOnlyQuery.

With this I solved my problem (find the master DataSource of DataModule) and I had semplified my code because in this case I can get the parameter for the StoredProc automatically from linked DataSource (master) without programmatically.

Thanks.