Newbie question on RecID

Rick Robinson rickrobinson at attbi.com
Wed Jan 22 12:37:50 CST 2003


I am able to make it work by doing

"select RecID,* from recipes"

but not

"select ** from recipes"

Rick

On Wednesday, January 22, 2003, at 12:26  PM, Rick Robinson wrote:

> What does:
>
> test = str(myDataBase.recipe.GetRecID)
>
> (Where myDataBase is my database object and recipe is my baseObject).
>
> Do?
>
> I see this code in some of the example. This actually does return a 
> number, but it does not seem to be the same each time I access a 
> record.
>
> The cursor is populated!
>
> Rick
>
> On Wednesday, January 22, 2003, at 12:06  PM, Keith DeLong wrote:
>
>>> 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
>>
>> _______________________________________________
>> Valentina mailing list
>> Valentina at lists.macserve.net
>> http://listserv.macserve.net/mailman/listinfo/valentina
>>
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://listserv.macserve.net/mailman/listinfo/valentina
>



More information about the Valentina mailing list