VBinaryLink delete bug

Ernesto Giannotta ernestogiannotta at tiscalinet.it
Mon Jun 15 08:32:09 CDT 2009


Hi Ruslan,

On 15/giu/09, at 08:30, Ruslan Zasukhin wrote:

> On 6/15/09 4:41 AM, "Ernesto Giannotta" <ernestogiannotta at tiscalinet.it 
> >
> wrote:
>
> Hi Erne,
>
>> I have a many to many Binary link set like this:
>>
>>   //  make the link
>>   mCatNotesLink = new VBinaryLink("Link_Categories_Notes",
>> mCategories, mNotes, EVLinkType.kMany, EVLinkType.kMany,
>> EVOnDelete.kSetNull)
>>
>> Now when I delete the last record in the mCategories table (which is
>> the owner of the link) like this:
>
> Owner?
>
> * For M:M link, Owner have no sense usually.
>
> * Yes, we still have provide ability specify Owner for M:M and 1:1  
> links.
> But above I do not see that you have specify Owner in code
>

you're right, I didn'set it
but the debugger shows it as the owner so I thought it was a somewhat  
relevant info...

>
>>   dim SqlString as String
>>
>>   SqlString = "Delete From " + me.Name
>>   SqlString = SqlString + " Where Recid = " + Str(inRecid)
>>
>>   Call me.Database.SqlExecute(SqlString)
>
> Better show FINAL SQL command.
>> From this RB code it is not clear what exactly command you get,
> Although I guess which
>
>    DELETE FROM Categories WHERE RecID = XXXX
>

yup! :-)

>
>> also all the linked records of the mNotes table are deleted!
>>
>> This happens only if I delete the last record of the owner table
>>
>> Workaround is to unlink all records before deleting the last owner's
>> record
>>
>> I'll try to make a simple demo to submit via Mantis.
>
> Yes, please Mantis it
>

done!


Cool Runnings,
erne.


More information about the Valentina mailing list