In an xBase world I do this by using a field in a 1 record table.  
Put your exception handling around the attempt to edit the record and 
it works a treat.

Go the extra step and inherit a table component, add properties for 
the table and field with the generator value, and a third one for the 
field in this table that is to receive the new value.  Add some extra 
functionality to the "BeforePost" event that only fires when 
posting an insert and you are done!

Works for me.

Steven



> I hope someone has some ideas as I'm stuck.
> 
> I have a situation where two delhi programs need to obtain an incrimenting
> unique ID number from the single source.
> 
> 
> So an example.
> 
> Delphi progrm 1 processes and gets unique ID 1000
> Delphi program 2 processes and gets inque ID 1001
> Delphi progrm 1 processes and gets unique ID 1002
> Delphi program 2 processes and gets inque ID 1003
> Delphi progrm 2 processes and gets unique ID 1004
> Delphi program 2 processes and gets inque ID 1005
> and so on....
> 
> So it's reasonably easy to use a single ini file or share a registry entry
> but what hapens when both programs want to get a unique ID at the same time.
> 
> In future I'll have more delhi programs that need to get the uniqie ID form
> the same source.
> 
> 
> Thanks for any help.
> 
> Jason Webb
> 
> 
> 
> ---------------------------------------------------------------------------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> 
> 


Wild Software Ltd
P O Box 33-216
Christchurch
NEW ZEALAND

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to