revdb error using record set (AltSQLite) -- Fixed

David Vaughan david at dvkconsult.com.au
Wed Dec 14 22:20:45 EST 2005


My apologies to all.

The line "get revdb_query(gConn,"SELECT * FROM taxl")" was the  
default in a SWITCH statement. I discovered eventually that a cutely  
simple error on my part meant that one of the earlier CASE statements  
was being executed where I had expected them all to be bypassed.  
However, the search in that CASE returned no data, something for  
which I was not testing because I was trying to get the DEFAULT code  
working first! The rest of the errors flowed from there.

sorry
David

On 15/12/2005, at 13:35, David Vaughan wrote:

> 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