revdb error using record set (AltSQLite)

chris bohnert chris at altuit.com
Wed Dec 14 23:59:09 EST 2005


David,

I simplified salient revdb api portions of your sample to:

 put revdb_query(tconnectionid,"select * from tax1") into tRS
 put revdb_columncount(tRS) into k
 repeat with i = 1 to k
     put revdb_columnByNumber(tRS,i) after field field1
 end repeat

the table tax1 has three columns with serveral rows.  No errors or crashes.

You might try setting a breakpoint before the repeat structure so you 
can step through the column access in the recordset.  If you still have 
trouble feel free to send me a sample off list and i'll take  a look at it.

--
cb


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
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
>





More information about the use-livecode mailing list