[V4RB] updating records ... where am i going wrong?

Pedro fp lists at pedro.Net.au
Tue May 13 05:25:02 CDT 2003


Than you Ruslan Update() worked a treat, but your example was wrong, it  
should have been b = c.Update ;) ... & thank you also for telling me  
where I do well :) ... I got that from reading your docs :)

As an experiment I set Panorama, which I'm an old fan of, to work  
recalculating the durations for me just before writing my plea for  
help. I wrote your email, got your reply, acted on it, tested it, found  
it worked & did the job of 98947 records & Panorama hasn't got half way  
through it. Here's the job report ...

98947 records imported.
Import completed in 25.254 seconds.
Durations calculated in 42.940 seconds.
Populate StyleGrid completed in 95.533 seconds.


On Tuesday, May 13, 2003, at 04:56  AM, Ruslan Zasukhin wrote:

> Pedro, I think for you task you should simply use Update()
>
>
>    dim i As integer, c As vCursor, b As boolean, nNew, nCur As double
>    dim newPhase, newDuration As vDouble
>
>    c = mDatabase.SQLselect( "SELECT phase1, duration FROM moon ORDER BY
> phase1" ) ' WHERE RecID > 0
>
>    if c.recordCount > 0 then
>
>      ' Assign cursor fields to variables.
>      newPhase = c.doubleField( "phase1" )
>      newDuration = c.doubleField( "duration" )
>        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ VERY GOOD :-)
>
>      for i = 1 to ( c.recordCount - 1 )
>        c.currentPosition = i + 1 ' Go to the record ahead.
>            nNew = newPhase.value ' Get the next new moon.
>        c.currentPosition = i ' Go back to the current record.
>
>        nCur = newPhase.value ' Get the current new moon.
>        newDuration.value = nNew - nCur ' Set duration as the  
> difference.
>        c.Update()
>

Cheers, Pedro :-)

Web: <http://www.pedro.net.au>                    PGP Key ID: 387CD96F
Instant messaging...  AIM: bandidoOfOz  ICQ: 27671678  Jabber: pedrofp
                       MSN: mail at pedro.net.au           Yahoo: pedro_fp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
~~~~~~
"Those who profess to favour freedom, and yet deprecate agitation, are  
men
who want crops without ploughing up the ground. They want rain without  
thunder
and lightening. They want the ocean without the awful roar of the  
waters. This
struggle may be both moral and physical, but it must be a struggle...  
The
limits of tyrants are prescribed by the endurance of those whom they  
oppress."
                                                              Frederick  
Douglas





More information about the Valentina mailing list