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>

Reply via email to