Subject HELP - Maintain a sequence number

I'm using IBO 4.2 Ed and programming in Delphi
I would like to know how can I implement a
sequence in a table, using IBO?
I will describe what I would like to do:

I have a table, named "FACTURACAO", with a PK
"ID_FACT". In my application, when a user inserts
a new row, I want to have de next ID. e.g. If
MAX(ID_FACT)=3 -> new ID_FACT=4
I could have multiple users inserting rows at
same time...

How can I prevent that the next number is given
only to one person? There are any way to lock the
record when I'm reading the generator? If a user
cancel a insert the sequence is rolled back?

I see the IBO help, and I had read something
about this, but I don´t understand the explain.

So, I hope you can help me...

Thanks, for all

Rui Batista

Crie o seu Email Grátis no Clix em