cursor delete

Ralf Sander ralf at end-if.de
Mon Mar 7 00:32:58 CST 2005


Am 05.03.2005 um 20:41 schrieb Ruslan Zasukhin:

> On 3/5/05 5:48 PM, "Ralf Sander" <ralf at end-if.de> wrote:
>
>> Hi list,
>>
>> the following sql string executed with kv_nolocks returns a cursor 
>> with
>> 1 record
>>
>> SELECT RecID,* From CatsRela Where [UniqeIDLeft] = '13' AND
>> [UniqeIDRight] = '2'
>>
>> the cursor is not readonly - as expected
>> but the record will not be deleted and vc.delete returns no error.
>>
>>
>>
>>      if vc<>nil then
>>        if vc.ReadOnly then
>> msgbox "read only"
>>        end
>>
>>        n=vc.RecordCount
>>        msgbox "•••record count"+str(n)
>>        b=vc.FirstRecord
>>        if not b then
>>          msgbox "••••••••not first record "
>>        end
>>        b=vc.Delete
>>        if not b then
>> msgbox  "•••error "+str(vdb.ErrNumber) + vdb.ErrString
>>
>>        end
>>      end
>>
>>
>> So what goes wrong?
>> Maybe I should mention, that the code is executed from another 
>> function
>> where another cursor on the same table was built to create records
>> (recid='0' / kv_readwrite)
>> but this should not have any affect to the cursor in this function,
>> right?
>
> No, it will.
>
> Because THAT SECOND USER have lock record.
> And he NOT expect to see that record have magically gone away
>

But in the first cursor is only for creating new records (RecID='0'). 
Does such a cursor automatically lock all records? Does any k_readwrite 
cursor lock all records?

Cheers,
Ralf



More information about the Valentina mailing list