I must confess that I found that Paradox autoincrement tables are prone to corruption 
at least upto BDE4.02.


-----Original Message-----
From:   Aaron Scott-Boddendijk [SMTP:[EMAIL PROTECTED]]
Sent:   Tuesday, June 01, 1999 12:30 PM
To:     Multiple recipients of list delphi
Subject:        Re: [DUG]:  Two Delphi programs need a single source

> 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.

1. Open a file for reading and writing with deny write sharing mode.
    If fail opening then wait a split second and retry.
2. Read ID+1 and write result to file and close file.

If it's for a database app you could use either

Paradox - autoinc field
SQL systems - a stored procedure
ORACLE - a sequence generator.

alternatively create a table with 1 field for each ID
open table exclusively and get next ID alter table to increment ID.
close table.

--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax


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

application/ms-tnef

Reply via email to