RB: isLinked?

Karl Grob kgrob at mus.ch
Mon Nov 21 08:50:42 CST 2011


Hi Ruslan

This is impossible (to much stuff) but today I found a similar problem and i give you my own log (part of it):
Link is MM

VException in 'Variante: SetKategorie ->KV.  .  /aAuU' - Fehler Nummer: 529688 / Message:The link "LnkMM_VariantenZuStatusTypen". Left-table record "3" is already linked to the right-table record "10".

VException in 'Variante: SetKategorie ->K .  .  /au' - Fehler Nummer: 529688 / Message:The link "LnkMM_VariantenZuStatusTypen". Left-table record "66" is already linked to the right-table record "10".
VException in 'Variante: SetKategorie ->K .S .  /ay' - Fehler Nummer: 529688 / Message:The link "LnkMM_VariantenZuStatusTypen". Left-table record "202" is already linked to the right-table record "10".
VException in 'Variante: SetKategorie ->KF.  .  /a' - Fehler Nummer: 529688 / Message:The link "LnkMM_VariantenZuStatusTypen". Left-table record "298" is already linked to the right-table record "10".
VException in 'Variante: SetKategorie ->KF.  .  /a' - Fehler Nummer: 529688 / Message:The link "LnkMM_VariantenZuStatusTypen". Left-table record "300" is already linked to the right-table record "10".

The problem is the following (1st Exception as a example):

Scan the string "KV.  .  /aAuU" char by char and link the valentina record for every significant char to a table with a list of corresponding categories. (The string is a field of a Clipper DB and contains different Types of textual-Variants - types for the Clipper-Record)
It is always the same type of variants that throws the error (RecID: 10) (in fact, the link is built (!). And it cannot be that the original string is twice the same Vrecord - all the other chars don't throw a error, it is only small "a" with the corresponding type (RecID 10).

Result: the link is built and the error is thrown (both!)

Best regards
Karl

The code
---------

Project: HKKA_Projekt_V2.rbp
Date: Montag, 21. November 2011 15:42:01

Variante.SetKategorie
Sub SetKategorie(s as string, myRid as Integer = 0)

dim rid, oldRid as Integer = 0
dim ch, tmp() as Integer
dim lnk as VBinaryLink = hkkaDB.myDB.LnkMM_VariantenZuStatusTypen 
dim mfld as VVarChar = hkkaDB.myDB.tblStatusTypen.fldBeschreibung 

if myRid = 0 then myRid = tbl.RecID  //tbl is defined in the class (SharedProperty), but myRid is in fact not 0.

for i as integer = 1 to len(s) tmp.append ASC(Mid(s, i, 1)) next

for i as integer = 1 to len(s) ch = ASC(Mid(s, i, 1))
If ch = ASC("a") then
rid = mfld.FindSingleValue(clStatusTypen.KiTxtZ_Ausdruck_Wort_Umstellung)
ElseIf ch = ASC("A") then
rid = mfld.FindSingleValue(clStatusTypen.VzRefTxt_Ausdruck_Wort_Umstellung)
ElseIf ch = ASC("f") then
rid = mfld.FindSingleValue(clStatusTypen.KiTxtZ_Druck_und_Schreibfehlerkorrektur)
ElseIf ch = ASC("F") then
rid = mfld.FindSingleValue(clStatusTypen.VzRefTxt_Druck_und_Schreibfehlerkorrektur)
ElseIf ch = ASC("h") then 
rid = mfld.FindSingleValue(clStatusTypen.KiTxtZ_Groß_Kleinschreibung) 
ElseIf ch = ASC("H") then
rid = mfld.FindSingleValue(clStatusTypen.VzRefTxt_Groß_Kleinschreibung) 
ElseIf ch = ASC("i") then
rid = mfld.FindSingleValue(clStatusTypen.KiTxtZ_Interpunktion) 
ElseIf ch = ASC("I") then
rid = mfld.FindSingleValue(clStatusTypen.VzRefTxt_Interpunktion) 
ElseIf ch = ASC("l") then
rid = mfld.FindSingleValue(clStatusTypen.KiTxtZ_lautliche_oder_flexionsmäßige_Differenz) ElseIf ch = ASC("L") then
rid = mfld.FindSingleValue(clStatusTypen.VzRefTxt_lautliche_oder_flexions mäßige_Differenz)
ElseIf ch = ASC("o") then
rid = mfld.FindSingleValue(clStatusTypen.KiTxtZ_Orthographie)
ElseIf ch = ASC("O") then
rid = mfld.FindSingleValue(clStatusTypen.VzRefTxt_Orthographie)
ElseIf ch = ASC("p") then
rid = mfld.FindSingleValue(clStatusTypen.KiTxtZ_Apostrophsetzung)
ElseIf ch = ASC("P") then
rid = mfld.FindSingleValue(clStatusTypen.VzRefTxt_Apostrophsetzung)
ElseIf ch = ASC("r") then
rid = mfld.FindSingleValue(clStatusTypen.KiTxtZ_direkte_Rede)
ElseIf ch = ASC("R") then
rid = mfld.FindSingleValue(clStatusTypen.VzRefTxt_direkte_Rede)
ElseIf ch = ASC("t") then
rid = mfld.FindSingleValue(clStatusTypen.KiTxtZ_Trennung_Zusammensch reibung)
ElseIf ch = ASC("T") then
rid = mfld.FindSingleValue(clStatusTypen.VzRefTxt_Trennung_Zusammens chreibung) 

…..

else
rid = 0 
End If

if oldRid <> rid then 
try
if rid > 0 and tbl.RecID > 0 then lnk.LinkRecords(tbl.RecID, rid) 
catch err
myExceptionhandler(err, "Variante: SetKategorie ->" + s) end try
end if 

next

End Sub


Am 19.11.2011 um 09:50 schrieb Ruslan Zasukhin:

> On 11/18/11 3:25 PM, "Karl Grob" <kgrob at mus.ch> wrote:
> 
>> The Link type is 1:M (as the name says). I changed it to M:M and now it works.
>> 
>> But this is not my real problem: Why doesn't the IF-Statement return true?
>> that is the real problem. If the error gives me a 'already linked'-response,
>> then the 'isLinked'-Question should give me true.
>> Logically this is independent from the question 1:M or M:M
> 
> Hi Karl,
> 
> May be you can send us something
>    small db + small rb project that open this db
>    and do isLinked and show wrong result
> 
> ?
> 
> 
> 
> 
> -- 
> Best regards,
> 
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
> 
> Valentina - Joining Worlds of Information
> http://www.paradigmasoft.com
> 
> [I feel the need: the need for speed]
> 
> 
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
> 



More information about the Valentina mailing list