Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Does anyone have a NEXTKEY() prog that can do this
Message
De
05/01/2002 11:18:11
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Does anyone have a NEXTKEY() prog that can do this
Divers
Thread ID:
00601141
Message ID:
00601141
Vues:
65
I have sometimes have trouble when opening 2 Database containers containing
the same NEXTKEY() stored proc.

IF I forget to use SET DATABASE TO then very often the nextkey routine will use the wrong nextkey table when I do an insert.

The solution I would like to see is a change to my nextkey() SP so that it ensures the keytable being used lives in the same DBC as the table requiring a new key.

something like.
lcDBC = cursorgetprop('database') && hopefully this will contain the name of the dbc() for the table being operated on but I am not sure

* --- Open table of next keys
If USED("NextKey") and dbc('database','nextkey')<>lcDBC
	use in  NextKey
endif

If USED("NextKey") 
   select nextkey
else
   Use (lcDBC+'!'+'nextkey')
Endif
I dont have the time to make and test this myself so I am hoping someone else has already done this somewhere
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform