[V4RB] isLinked-Test and Error 529689

Karl Grob kgrob at mus.ch
Tue Jan 3 03:38:34 CST 2012


Hi,

Some time ago I asked a question about a 'impossible' error considering "isLinked" and the error "is already linked". It was then a M:M-Link.

This time it is as 1:M Link:

How can it be that I get a error "kM's table Record is already linked to some kOne…" at the position of the arrow (<===). And this after the test if the 2 Records are linked? BTW: To me this code must work totally independent of the parameter-values. The error is not thrown at every occasion, with most of the records it works.

--------------
  
dim recs(1) as Integer
  dim myLnk as VLink = DB.tblAbsatzformate.Lnk11_AbsatzformateZuTabulatoren
  dim myAutoLnk as VLink = DB.tblAbsatzformate.Lnk1M_AbsatzformateAuto
  
  if lnkTo = 0 then
    name = eFlds(1)
  else
    name = eFlds(0)
  end if
  
  
  if instr(name, "<?>") = 0 then
    if InStr(name,".indd@") > 0 then name = right(name, len(name)-instr(name,c15_InternerFormatTrenner)+1)
    eTblA.SeTblank
    eTblA.fldFormatname.Value = name
    
    if lnkTo > 0 and eTblA.RecID > 0 then
      if not myAutoLnk.IsLinked(lnkTo, eTblA.RecID) then
        try
          myAutoLnk.LinkRecords(ARRAY(lnkTo, eTblA.RecID)) // <===================
        catch err
          myExceptionhandler(err, "mNeuesAbsatzformat:try lnkTo")
        end try
      end if
    end if
    
-------------------

Best regards and a happy New Year
Karl

RB 2011 R4
VRB.rbx 23.06.2011



More information about the Valentina mailing list