Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Incrementing VFP database table in DotNet winform client
Message
De
17/03/2008 16:59:15
 
 
À
17/03/2008 16:48:40
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01302805
Message ID:
01302811
Vues:
13
>>Greetings,
>>
>>We have a system that uses VFP databases/tables. To keep track of the next ID for a given table we use the typical structure...
>>
>>TableName C(20)
>>NextID I
>>
>>In VFP client apps incrementing the key is easy with code like...
>>
>>
>>Parameters lcTablename
>>
>>IF !USED("id")
>>   use p:\id in 0
>>ENDIF
>>select id
>>locate for id.tablename = lcTablename
>>IF !EOF()
>>   if rlock()
>>     lnNextkey = id.nextid
>>     replace id.nextid with lnNextkey + 1
>>   endif
>>ENDIF
>>...etc.
>>
>>
>>Now we are building a .NET winform application in C#. Hooking up to the tables were easy enough but now we are struggling to find a 'best practice' to incrementing the keys. We can increment using ADO but there is no record locking so there is a possibility of duplicate keys if many users are utilizing the application.
>>
>>I'm posting here in the VFP forum becuase it is a unique problem to VFP. Any help would be greatly appreciated.
>>
>>Greg
>
>rlock() is available to VFPOLEDB when used in an SP.
>Cetin

Thanks for the help! Do you know of any articles that would assist in implementing this?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform