Class TCounterLink (unit DBCountr) |
Inherits from
TDataLink
procedure ActiveChanged;
////////////////
// TCounterLink //
////////////////
procedure AssignNextNumber;
Version 1.
procedure CounterBeforePost(DataSet: TDataSet);
Version 1.
procedure CounterOnPostError(DataSet: TDataSet; E: EDatabaseError;
var Action: TDataAction);
Version 1.
function NextNumber: TCounter;
Version 1.
procedure SetTable(obj: TTable);
OpenCounterFile} {NextNumber
property CounterField : string
property CounterValue : TCounter
property GetMaxValMethod : TGetMaxValMethod
property MaxLockRetry : TMaxLockRetry
property Table : TTable
CounterFieldObj : TField;
CounterFile : string;
FCounterField : string;
FCounterValue : TCounter;
FGetMaxValMethod : TGetMaxValMethod;
FirstActivation : boolean;
FMaxLockRetry : TMaxLockRetry;
FTable : TTable;
PostRetried : boolean;
TableBeforePost : TDataSetNotifyEvent;
TableOnPostError : TDataSetErrorEvent;
procedure ActiveChanged;
////////////////
// TCounterLink //
////////////////
procedure AssignNextNumber;
Version 1.103 - restore table's BeforePost method
procedure CounterBeforePost(DataSet: TDataSet);
Version 1.103 - new method
procedure CounterOnPostError(DataSet: TDataSet; E: EDatabaseError;
var Action: TDataAction);
Version 1.103 - this method replaces UpdateData method as it will only be
called when necessary. I didn't realise UpdateData is called so often - the
counter value was being incremented each time and many values were being
wasted. Now, only one new value is used per post, unless CounterOnPostError
is triggered.
function NextNumber: TCounter;
Version 1.103 - AssignNextNumber replaces call to UpdateData
procedure SetTable(obj: TTable);
OpenCounterFile} {NextNumber
property CounterField : string
property CounterValue : TCounter
property GetMaxValMethod : TGetMaxValMethod
property MaxLockRetry : TMaxLockRetry
property Table : TTable
CounterFieldObj : TField;
CounterFile : string;
FCounterField : string;
FCounterValue : TCounter;
FGetMaxValMethod : TGetMaxValMethod;
FirstActivation : boolean;
FMaxLockRetry : TMaxLockRetry;
FTable : TTable;
PostRetried : boolean;
TableBeforePost : TDataSetNotifyEvent;
TableOnPostError : TDataSetErrorEvent;