Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Local Views at Wits End
Message
 
À
10/06/2003 09:33:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00796970
Message ID:
00798510
Vues:
37
Erik,

I also use a view on a table (dbrecord) that gets primary keys. The dbRecord table could be in VFP, sql*server or Oracle. I also buffer the view, which I have seen that BP says is not a good thing? Anyway, here is a snip of code that I use, I hope it helps. If you do use buffering, you may want to check the value of set('multilocks').
** multilocks is ON
For nTries = 1 to 100   && try 100 times to update key and save
    Select v_dbrecord   && view on dbrecord
    lSuccess=CURSORSETPROP("Buffering", 5, "v_dbrecord")
    pcDatabase=alltrim((lcdbfname))+"%"
    Requery()
    ln_value=record_no+1
    Replace record_no WITH ln_value
    Replace UPDATED WITH DATETIME()
    llSave=tableupdate(.t.,.f.)
    If llSave
	Exit
    Else
	llRevert=tablerevert()
	Wait window timeout 0.2 "Trying to get New ID #.  Failed on "+alltrim(str(ln_Value))
    Endif
Endfor
** pass ln_value back to the calling app
Kevin
Kevin Emmrich
www.jkt9000.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform