Thread View: borland.public.vdbase.forms
3 messages
3 total messages
Started by Frank Loomer
Wed, 31 Mar 1999 00:00
Mass Replace
Author: Frank Loomer
Date: Wed, 31 Mar 1999 00:00
Date: Wed, 31 Mar 1999 00:00
14 lines
1011 bytes
1011 bytes
I've tried the following loop to mass replace a text field with the
current date.
===========
Form.query1.rowset.first()
Do while not form.query1.rowset().last
form.query1.rowset.fields["Curr_date"].value := dtoc(date())
form.query1.rowset.next()
Enddo
===========
The loop works, but the the value change doesn't take..
On the other hand, the form....value statement works fine as a
standalone statement. ie if you take it out of the loop and run it after
the Enddo, the change works.
What am I doing wrong?
Re: Mass Replace
Author: Gary White [dBVIPS]
Date: Wed, 31 Mar 1999 00:00
Date: Wed, 31 Mar 1999 00:00
26 lines
1163 bytes
1163 bytes
On Wed, 31 Mar 1999 07:52:16 -0400, Frank Loomer wrote: > I've tried the following loop to mass replace a text field with the > current date. > =========== > Form.query1.rowset.first() > Do while not form.query1.rowset().last The above line couldn't possibly work. If it did, it would move you to the last record before you ever make any changes. Try changing it to: do while not form.query1.rowset.endOfSet Please move to the dBASE2000 News Groups at news://news.dbase2000.com as soon as possible The groups here will close very soon. Gary White [dBVIPS] Some dBASE Stuff at http://www.AppTools.com/dbase
Re: Mass Replace
Author: Ken Mayer [dBVIPS]
Date: Thu, 01 Apr 1999 00:00
Date: Thu, 01 Apr 1999 00:00
27 lines
1167 bytes
1167 bytes
Frank Loomer <loomerf@nbccsj.gov.nb.ca> wrote: >=========== >Form.query1.rowset.first() >Do while not form.query1.rowset().last > form.query1.rowset.fields["Curr_date"].value := dtoc(date()) > form.query1.rowset.next() >Enddo >=========== >The loop works, but the the value change doesn't take.. >On the other hand, the form....value statement works fine as a >standalone statement. ie if you take it out of the loop and run it after >the Enddo, the change works. >What am I doing wrong? In addition to Gary's response, see UPDATE SET in the language reference -- it's faster. Ken --- Ken Mayer [dBVIPS] GO HERE! NOW! news.dbase2000.com These newsgroups are going away fast!
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads