revdb error using record set (AltSQLite)
David Vaughan
dvk at dvkconsult.com.au
Wed Dec 14 21:35:06 EST 2005
Using a licenced AltSQLite as the database, I created a record set
and endeavoured to extract data using the following code (some error
checking and other irrelevant pieces omitted from both fragments):
handler 1
get revdb_query(gConn,"SELECT * FROM taxl")
put it into p
set the cursors of this stack to p
get revdb_moveFirst(p)
newRecDisplay
on newRecDisplay
put the cursors of this stack into p
put revdb_columncount(p) into k
repeat with i = 1 to k
put revdb_columnByNumber(p,i) into field i
end repeat
The code executes but at first put something like "revdberr, invalid
column number" into each field but now pretty consistently just
crashes Rev.
The database is open and a few rows of data exist in it with three
columns, fully populated, in each row. I can see that data using
revdb_queryList() so one option is to switch away from using the
cursor structure and just manage the returned data in variables
myself. Before making that move, I would like to know if I have made
a mistake in this code or have encountered a bug in the RR wrappers
or in AltSQLite.
I added revdb_moveFirst() in the first handler, as a trial fix
although I expect that the cursor would automatically be pointing to
the first record.
thanks
David
More information about the use-livecode
mailing list