Unique field bug?

Ruslan Zasukhin sunshine at public.kherson.ua
Sat Oct 23 22:21:19 CDT 2004


On 10/23/04 9:47 PM, "jda" <jda at his.com> wrote:

> I'm adding records in which there is one unique field, uniqueID. I
> trying to trap for exceptions with the following code:
> 
>      i = myCursor.LongField("uniqueID").value
>      do
>        try
>          cursPosition = myCursor.addRecord
>          catch vError as VException
> 
>          if cursPosition = 0 then //and myDatabase.errNumber = 344

Note, 2.0 have different numbers for error codes!!!
So it is not 344.

> then duplicate uniqueID --will update when v2 has error constants
> 
>            i = i + 1
>            myCursor.LongField("uniqueID").value = i
>          else
>            raise vError
>          end if
>        end try
>      loop until cursPosition <> 0
> 
> The exceptions are trapped properly, but when it's finished a record
> is added for EVERY time cursPosition = myCursor.addRecord was called.
> 
> So if the first add -> exception and the second is successful, I end
> up with two records (each having the same uniqueID value, BTW!).

I have not understand,

You say that record IS ADDED _and_ exception is throw?


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina-beta mailing list