Page 1 of 1

TzDatasource

Posted: 03.11.2012, 16:18
by sfxcc
Can i develop a TzDatasource to trigger error events to TzDatasource.


When we have a Tdatamodule used for all software we cant set error messages for specific purposes we dont know in which form we where and the "DbControls used to exec error".

So can i develop a TzDatasource and you set then

On procedure internaladd and internalupdate
begin
For each Tabledatasource = TzDatasource do
TzDatasource.OnPostError
TzDatasource.OnEditError
end

So we can catch the errors on the correct datasource to set actions to the datasource dependent Dbcontrols.

Posted: 03.11.2012, 20:53
by sfxcc
How can i get the primary key fields with Zeos ,

Can it be done a a zquery or zTable ?

Didnt find it , on paradox it works with fieldsdefs.

Posted: 04.11.2012, 19:43
by EgonHugeist
sfxcc,

ZConUnicode.DbcConnection.GetMetadata.GetPrimaryKeys(const Catalog: string; const Schema: string; const Table: string): IZResultSet;

Does it very well...

Posted: 26.11.2012, 14:38
by mdaems
Or using the ZMetadata component. Then you get a pure TDataSet back.
But I suppose sfxcc wants to know if there's a property on the query result fields that indicate if the current field is part of the primary key.

Checking TZAbstractRODataset.InternalInitFieldDefs where we create TFieldDef information makes me think that's not the case. If there's a standard Delphi TFieldDefs property to contain this information it might be relatively easy to add this information.

Mark