Newbie question on RecID

Keith DeLong delong at redcort.com
Wed Jan 22 11:06:21 CST 2003


> This isn't working, I get an exception when I try:
> 
> rnumber = myCursor.ULongField("RecID").value

I'd guess that either mycursor didn't select recID or rNumber is not an
integer.

Try MsgBox cursor.field("RecID").getstring

> I've checked that my select is using "**" instead of just "*".

As long as you've done a select properly, it means you've got the RecID in
your cursor. 
 

To check your cursor try:
Msgbox str(cursor.recordcount). This will tell you if you have a valid
cursor with how many records in it. If it throws an exception, cursor is not
populated yet.

> I can't see the RecID from within the Valentina App. Am I supposed to
> be able to? 

No. The RecID is a value internally generated by Valentina. Every record has
one. It's helpful for me to think of it as the line number of a table. It's
a real thing but not a field in the table.

> I assume the RecID is created automatically? When does that
> happen? 

As soon as you add a record, it has a location (if you will a line number in
a table). If you delete this record, this 'line' now has no record therefore
there is no RecId. When you add another record, it could be saved to this
line in the future. It's helpful to remember then that RecID's will be
reused.

> Is it possible there is no field RecID in my table/baseobject?

No. 

It'll start to make a lot more sense as you grasp Ruslan's logic :-)

Keith DeLong



More information about the Valentina mailing list