You should also be aware that when you delete a record the rowid is not
recovered until you do a compress on the table.  BUT, when you do a
compress on the table your next request for a rowid may already exist in
your table, hence the values will not be unique.  

Using rowid as a unique attribute value for your table is not a great
idea in MapInfo.  There is too much room for errors (duplicate values)
as the rowid values can be re-assigned.

-----Original Message-----
From: Fabio Cabella [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 15, 2003 09:01 AM
To: [EMAIL PROTECTED]
Subject: MI-L Wrong RowIDs

Hi All,

I'm adding some graphical objects into a table. For each I store the
RowID 
so I can remove those objects.
I do something like this:
    Do "Insert Into myTable(Obj) values(CreatePoint(_lat_, _long_))"
I use Eval "myTable.RowID"  to retrive the new insetred rowID.
If I insert only points I get the right RowID.
If I insert lines between points
    Do "Insert Into myTable(Obj) values(CreatePoint(_lat1_, _long1_))"
    Eval "myTable.RowID" gives me 1
    Do "Insert Into myTable(Obj) values(CreateLine(_lat1_, _long1_,
_lat2_, 
_lat2_))"
    Eval "myTable.RowID" gives me 2
    Do "Insert Into myTable(Obj) values(CreatePoint(_lat1_, _long1_))"
    Eval "myTable.RowID" gives me 2!!!!

Why do I get 2 and not the correct 3 value?????

Note: I'm handling this code through a VC application and if I debug it 
step by step I get the right RowID!?!?!

Is 'Eval "myTable.RowID"' the right way to get the new inserted RowID?
Is there something I'm missing?

TIA,
Cabbi


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 9561


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 9646

Reply via email to