crash on empty cursor

Olivier vidal_olivier at yahoo.fr
Mon Jan 10 20:17:19 CST 2005


Le 10 janv. 05, à 20:05, Ruslan Zasukhin a écrit :

> On 1/10/05 8:57 PM, "Olivier" <vidal_olivier at yahoo.fr> wrote:
>
>> Hi list,
>>
>> I have a cursor :
>> SELECT recId, string1, string2 FROM Table1 ORDER by string1
>>
>> If this cursor is empty, then, later, the "cursor.addrecord()" method
>> crashes the app.

In Valentina 1, it works.

>>
>> Naturally, it is better to use " where RecId=0 " but sometimes we have
>> not the choice.
>
> Hmm,
>
> The correct way NOW produce empty cursor for adding of records is
>
> SELECT recId, string1, string2
> FROM Table1
> WHERE false
> ORDER by string1
>
>

It is necessary to replace every " where recid=0 " by " where false "? 
(It would be necessary to correct doc)

In the presented case, I do not know early if the cursor will be empty.
It is more practical to be able to add records that the cursor is empty 
OR not.

In Valentina 1, this query worked:
>> SELECT recId, string1, string2 FROM Table1 ORDER by string1
rs=cursor.add()





More information about the Valentina-beta mailing list