Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Incrementing VFP database table in DotNet winform client
Message
De
19/03/2008 09:45:07
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
17/03/2008 16:59:15
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:
01303316
Vues:
14
>>>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?

I use the help file that ships with VFP:)
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
Répondre
Fil
Voir

Click here to load this message in the networking platform