I have a global rowset that is populated in my app correctly in one of the methods.I iterate through the rowset using a For Each - Next loop . Afterwards all the columns in the rowset get set to Nil?? Any ideas why this would be happening? Does iterating set them to Nil
gPicList = db.SelectSQL("SELECT * FROM Pictures " +_
"inner join locations on lid = Locid where detailid = " + gDetailID)
Figured it out, removed the iterator and just used gpiclist.MoveToNextRow and it works fine. the iterator must clear out the values after the iteration…
After you walked through all the databaserows in the rowset there is nothing more to see. It sounds like you’re asking “why are there no words after the last page of my book?”. Or am i misunderstanding something here?
This sample you have does not iterate through a rowset, but rather through a list, If you save a rowset as a global and iterate through it, all the data is lost.
I’m sorry but I don’t understand what you are saying, the code is:
For Each row As DatabaseRow In data
DataList.AddRow(row.Column("ID").StringValue, row.Column("Name").StringValue, _
row.Column("Coach").StringValue, row.Column("City").StringValue)
DataList.RowTagAt(DataList.LastAddedRowIndex) = row.Column("ID").IntegerValue
Next
and is iterating on the 3 records on the rowset adding the values to a listbox. Then iterate again and put another 3 records on the listbox.
Not sure what you mean for save a rowset as a global, maybe creating a module and adding a rowset property there? It works too:
Hmm, interesting. I can’t seem to reproduce it in the sample file. and yes the global rowset I had was in a module with the rowset property. I didn’t close the rowset so it’s not that. I’ll have to go back and add the iterator to my project and see if I can make it happen again…
Ah made it fail. I have a check on another module that checks if there is an ID value in the global list. It doesn’t find any as all the values are nil ForSharon.zip (16.7 KB)