Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3819

DatabaseRow type and current record

$
0
0

Am I missing something here?

Iterating a RowSet provides references to elements of DatabaseRow type.
What I am looking for is a way to assign a DatabaseRow type outside an iterator ?

Examples below simplified for clarity.

//this works
Var rs As RowSet = db.SelectSQL(myQuery)

For Each record As DatabaseRow In rs
  DoSomethingWith(record)
Next 

Sub DoSomethingWith(record as DatabaseRow)
  Var name As String
  name = record.Column("name").StringValue 
End Sub
//but how to do this?
Var record As DatabaseRow, name As String
Var rs As RowSet = db.SelectSQL(myQuery)

rs.MoveToFirstRecord

record = ????  //what to assign to record?

name = record.Column("name").StringValue 

8 posts - 5 participants

Read full topic


Viewing all articles
Browse latest Browse all 3819

Trending Articles