🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.vdbase.data.sql
Article #307

Re: Help!

#307
From: Jean-Pierre Martel
Date: Wed, 30 Dec 1998 00:00
47 lines
1842 bytes
I didn't try it but I would do :
   R1 = Form.DATAMODREF1.ref.basename1.rowset
   R1.first()
   DO WHILE NOT R1.endOfSet  // no parenthesis
      IF R1.fields["MYFIELD"].value=something
         DO something  // ex : R1.fields["MYFIELD"].value=somethingelse
      ENDIF
      R1.next()
   ENDDO

But if your table is very big AND already indexed on MyField, I would rather
do :
   R1 = Form.DATAMODREF1.ref.basename1.rowset
   R1.setRange("MYFIELD = 'something' ")
   IF R.count() > 0
      R1.first()
      DO WHILE not R1.endOfSet  // no parenthesis
         DO something  // ex : R1.fields["MYFIELD"].value=somethingelse
         R1.next()
      ENDDO
   ELSE
      MsgBox("No record contains " + trim(something)), " Sorry . . . ", 48)
   ENDIF
   R1.clearRange()


Jean-Pierre Martel
MGA Communications - Montr�al - Canada

Enes Boric a �crit dans le message <36892BFF.62703CDB@ionline.net>...
>I'm trying to make something like this into vdb 7.1 but
>I can't.
>
>I tried
>r=form.DATAMODREF1.ref.basename1.rowset
>r.first()
>DO WHILE NOT rowset.endOfSet()
>   IF r.fields["MYFIELD"].value=something
>      DO something  (r.fields["MYFIELD"].value=something etc)
>   ENDIF
>   r.next()
>ENDDO
>
>But I couldn't get the resoults that I expected. Can somebody please
>tell me where
>i'm making the mistakes?
>Thank you.
Technical Details
Message-ID: <76cck2$qlf5@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <36892BFF.62703CDB@ionline.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: ff5a1,39f26e02c5ad06b2
X-Google-Attributes: gidff5a1,public
From: "Jean-Pierre Martel" <jpmartel@videotron.ca>
Subject: Re: Help!
Date: 1998/12/30
Message-ID: <76cck2$qlf5@forums.borland.com>
X-Deja-AN: 427012319
References: <36892BFF.62703CDB@ionline.net>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.vdbase.data.sql