Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Appending doing replacing
Message
De
20/06/1998 12:55:33
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00110241
Message ID:
00110244
Vues:
21
>Hi all,
>
>I'm leaving tomorrow and will be gone all week, so if I don't get a reply today, I won't see it until next Saturday. (Just so you know I'm not ignoring you)
>
>As people suggested in another thread, I have a stored procedure that gets the next key number. In the default of the key, it calls this function. The problem is that when I have that in the default, every record it appends goes on top of the last one, so I always have only one record.
>
>Here's the procedure code:
>
>procedure GetKey
>parameter lcKeyName
>
>local lnKeyNum
>
>use KeyList in 0
>
>locate for alltrim(KeyList.KeyName) = alltrim(lcKeyName)
>replace KeyList.KeyNum with KeyList.KeyNum + 1
>lnKeyNum = KeyList.KeyNum
>
>select KeyList
>use
>
>return lnKeyNum
>
>Here's what's in the default of the field clientkey: getkey('client')
>
>What am I doing wrong?
>
>Thanks,
Michel reading quickly maybe I'm also missing but after "use keylist in 0" you don't select keylist so locating in current (which is most likely EOF).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform