I don't think it's With ... End With as same without.
So Kilill can rest :-)
Joakim
> -----Original Message----- > From: valentina-bounces (at) lists D.OT macserve.net > [mailto:valentina-bounces@lists.macserve.net] On Behalf Of > Ruslan Zasukhin > Sent: 30 April 2006 13:50 > To: valentina (at) lists D.OT macserve.net; kirill_pekarov@valentina-db.com > Subject: Re: NextRecord and ObjectPtr? > > On 4/30/06 2:06 PM, "Joakim Schramm" <joakim (at) astrocalc D.OT com> wrote: > > > Why does the (VB6) code below not work? NextRecord does't > do anything > > just stay on same RecId 1, so field references etc. never > gets updated > > etc. does COM object don't work with With ... End With? > > Kirill, > > Please check point with in VCOM asap > > With ... End With > > > > Dim IdRec As Long > > Dim B As Boolean > > Dim sKey As String > > Dim fldPtr As VField > > Dim fldFK As VField > > Dim fldPK As VField > > Dim mTblCountry As VTable > > Dim mTblAlias As VTable > > > > 'prepare binary links > > 'Set mLinkCA = mDatabase.Link(lnkCountryAlias) Set mTblCountry = > > mDatabase.Table(tblCountry & sLang) Set mTblAlias = > > mDatabase.Table(tblCountryAlias) > > > > With mTblAlias > > Set fldPtr = .Field("PtrAlias") > > Set fldFK = .Field("CID") > > Set fldPK = mTblCountry.Field("CID") > > Call .FirstRecord > > > > Do While Not .EOF > > sKey = Trim$(fldFK.Value) > > IdRec = fldPK.FindSingle(sKey) > > > > If IdRec <> 0 Then > > fldPtr.Value = IdRec > > .UpdateRecord > > Else > > MsgBox "No " & sKey > > End If > > > > B = .NextRecord > > Loop > > > > End With > > > > Only part working is > > > > sKey = Trim$(fldFK.Value) > > IdRec = fldPK.FindSingle(sKey) > > > > If IdRec <> 0 Then > > fldPtr.Value = IdRec > > .UpdateRecord > > Else > > MsgBox "No " & sKey > > End If > > > > What am I doing wrong? > > > -- > 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@lists.macserve.net > http://lists.macserve.net/mailman/listinfo/valentina >
_______________________________________________ Valentina mailing list Valentina (at) lists D.OT macserve.net http://lists.macserve.net/mailman/listinfo/valentina
©2006 Joakim Schramm |