[V4RB] Question about adding records in cursors

Kevin Windham kevo at gatorgraphics.com
Mon Jan 27 14:00:04 CST 2003


I am working on an app where I will be adding records to the same 
tables from different sources. I remember some discussion about using 
cursors being better than relying on the base object methods due to 
some kind of confusion that can happen with base object methods

Looking through the documentation, I don't get any clear indication on 
what is the best implementation practice. So I have a few questions.

1. Can I create an empty cursor and add records to it? If so, how? Do I 
pass an SQL statement that won't match records. Is there an easy way to 
do this.

The reason I want to do this is to utilize the database as persistent 
object storage. I will be creating a record for each object(sometimes 
several records for objects which encapsulate other objects) , and I 
want to be able to create them at will without needing to worry about 
other parts of my program getting the wrong info from the table 
buffers, or overwriting info I am currently putting in the table.

2. After I add a record, whether it be through a cursor or a base 
object method, what is the best way to get that record's RecId? If I 
can easily create an empty cursor and then add a record to it I can 
just getRecID on the first record. Is there any simple way to do this? 
Perhaps a function that creates the record and returns the ID? If not, 
can I rely on the current record pointer always pointing at the record 
I just created? Does this change if I am using baseobject methods or 
cursor methods?

3. Are these issues discussed in any of the tutorials or docs that I 
might have missed.

Thanks a bunch,
Kevin



More information about the Valentina mailing list