[Gambas-user] Connection.Create and .Index

Benoît Minisini gambas at ...1...
Mon Nov 29 20:52:01 CET 2010


> hi,
> 
> i'm confused about the output i get from:
> 
> PUBLIC SUB test()
> 
>    DIM hResult AS Result
> 
>    'hConnection is an established Connection, with existing Table
> "test", Fields "id", db.Serial Primary Key, "name" db.String
>    hResult = hConnection.Create("test")
>    PRINT hResult.Index
>    hResult["name"] = "Aaron"
>    hResult.Update()
>    PRINT hResult.Index
>    hResult["name"] = "Zacharias"
>    hResult.Update()
> 
> END
> 
> i get in console:
> 0
> 0
> 
> but i thought the second PRINTed Index should be 1? the records are fine
> but with both indizes 0 shouldn't the first be overwritten with
> "Zacharias" or is there another internal pointer to specify the record??
> 
> regards,
> tobi
> 

In creation mode there is only one record in the Result object, the record 
that will be created. So Result.Index always returns 0.

Regards,

-- 
Benoît Minisini




More information about the User mailing list