is this correct?

Pedro fp lists at pedro.Net.au
Tue Feb 11 00:50:06 CST 2003


G'day Folks

To maintain a couple of persistent values I'm using a table in my 
database with 1 record. Three of those values are for the ID numbering 
of records. One is a line number which must be sequential & not have 
numbers re-used when records are deleted [so RecID isn't suitable]. The 
other 2 contribute to the construction of an ID code with only one 
being used in any batch of data being imported.

In the following code nc is a vCursor & nfName holds the name of field 
being used for the ID codes. Although I believe I'm following the V4RB 
manual closely I'm not sure that I've got it right because no 
autocomplete happens for UMediumField on the 2 lines just before b = 
nc.update(). Any tips?


       ' Get next record numbers.
       qs = "SELECT nextRec, " + nfName + " FROM prefsGlobal"
       nc = gxbSDB.SqlSelect( qs )
       nextLine = nc.UMediumField( "nextRec" ).value
       nextID = nc.UMediumField( nfName ).value

       ' Perform import
       ' a whole lot of stuff is done here updating
       ' nextLine & nextID along the way.

       ' Update next record numbers
       nc.UMediumField( "nextRec" ).value = nextLine
       nc.UMediumField( nfName ).value = nextID
       b = nc.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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"The world economy has devastated the lives of millions of innocent
people, it has transferring resources systematically from poor
countries to rich countries, and it is destroying the earth."
                       James Robertson in 'Future Wealth', 1990, p68





More information about the Valentina mailing list