Database Strategy

Bob Sneidar bobs at twft.com
Fri Nov 18 16:58:15 EST 2011


If you are working with cursors, my personal preference is to parse the data from the cursor, and then close it and forget about it. If you need new data, requery the database. 

I have mentioned before on the list that sqlYoga has functions for querying a database and returning an array that is compatible with datagrids. By passing that array in setting the dgData (set the dgData to aQueryArray) you have a very simple way to populate the datagrid without any of that messy parsing. 

sqlYoga is well worth the price for anyone doing serious database work in Livecode. 

Bob
On Nov 16, 2011, at 9:03 AM, mike at doub.com wrote:

> I am new to the world of databases and I need some advise.  
> 
> I am currently opening and closing the database in the open and close stack handlers. I am storing the connection I'd in a custom stack property. 
> 
> When I go to a card, I am creating a cursor, directly loading each record  into the datagrid.  Upon closing the card I close the cursor. 
> 
> Now this works fine when I load rev for the first time and go to the card with the datagrid.  When I leave the card and return, I am getting errors indicating I have invalid cursor ID. 
> 
> So should I be opening and closing the entire database in the card?
> I am not seeing anything wrong examining the close cursor function. 
> 
> As a separate question can you have multiple cursors open at the same time.  I would think so. 
> 
> Thanks in advance. 
> 
>  -= Mike
> 
> 
> Sent from my BlackBerry device on the Rogers Wireless Network
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list