Board index » off-topic » why autoinc fields set a number after post ?

why autoinc fields set a number after post ?


2005-08-19 05:10:17 PM
off-topic11
Hello,
When I insert a new row the autonumeric field is incremented by the system.
starting with 1, 2, 3,...
I try set negative numbers -1, -2, -3.... but the system change it for 1, 2,
3 after post
and raised the exception "Key violation".
regards
 
 

Re:why autoinc fields set a number after post ?

Carlos is rumoured to have said:
Quote
Hello,

When I insert a new row the autonumeric field is incremented by the
system. starting with 1, 2, 3,...

I try set negative numbers -1, -2, -3.... but the system change it
for 1, 2, 3 after post
and raised the exception "Key violation".
There was a bug in AdoDb.pas in D6, not recognising negative values for
ftAutoInc and ftInteger. (Looks like it has #2379 in QualityCentral,
fixed both in BetterAdoDataSet and in Delphi build 7.0.8.1.)
Maybe that causes your problem, if you are using ADO.
-tor
 

Re:why autoinc fields set a number after post ?

I don't use decimals numbers.
 

{smallsort}

Re:why autoinc fields set a number after post ?

The problem is when I post ClientDataSet.
It changes after post with an autonumeric starting with 1, 2, 3.
example if OnNewRecord set a -102 and when I post the
record it changes to 1, 2, 3,.......
The error is in the client raise an exception "Key violation"
when autonumeric numbers exists in table