That should be either
D = CategoryInfoRS.Field("_rowid_").IntegerValue
or
D = CategoryInfoRS.Field("rowid").IntegerValue
I prefer to use _rowid_ because when we search/find for it in the IDE
it 'sticks out' more. i.e. you may have a var defined as
myRowid so when you search for Rowid, all of the vars with Rowid
in it show up a well as all of the places you refer to that column.
Making it _rowid_ will just return where you referred to that
column in code.
Jay Wooten, President
Go Data Systems, Inc.
www.godatasystems.com
[EMAIL PROTECTED]
On May 12, 2006, at 7:25 PM, Dennis Birch wrote:
I just tried:
ID = CategoryInfoRS.Field("_rowid").IntegerValue
and I'm still getting a NilObjectException (a further test shows that
.Field("_rowid") is nil.
Any other suggestions?
On 5/12/06, Trausti Thor Johannsson <[EMAIL PROTECTED]> wrote:
if you don't create a variable which is an integer primary key, it
gets created for you, and it is called _rowid, note the _sign there.
Trausti
On May 13, 2006, at 12:55 AM, Dennis Birch wrote:
> I'm having no luck trying to figure out how to use what I
understand
> is an automatically generated field for a REALSQLDatabase.
>
> According to the LR: All REAL SQL Database tables have an Integer
> Primary Key column. If you don't explicitly such a column, one
will be
> created for you. You can refer to the INTEGER PRIMARY KEY column
using
> the "rowid" keyword.
>
> So I wrote the following code to store the rowID in a listbox where
> I'm showing the table's other values:
>
> CategoryInfoRS.MoveFirst
> While not CategoryInfoRS.EOF
> s = CategoryInfoRS.Field("bc_Name").StringValue
> if s <> "" Then
> CatList.AddRow s
> s = CategoryInfoRS.Field("bc_Code").StringValue
> CatList.Cell(CatList.LastIndex, 1) = s
> s = CategoryInfoRS.Field("bc_Type").StringValue
> CatList.Cell(CatList.LastIndex, 2) = s
>
> ID = CategoryInfoRS.Field("rowid").IntegerValue ' ---> NOE
HERE
> CatList.CellTag(CatList.LastIndex, 0) = ID
> End
> CategoryInfoRS.MoveNext
> Wend
>
> And I get a NilObjectException when I run this code at the point in
> the code indicated (NOE HERE) because .Field("rowid") is nil.
>
> Can somebody help me make this work correctly?
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>