Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Relational Databases
Expertise: Beginner
May 9, 1997

Database management program for multi-user

Question:
I am using Delphi 1.0 and am having a hard time trying to find commands/procedures/modules to lock a record from a Paradox database. What should I do to lock a single record from a database file for exclusive access?

Answer:
Paradox uses an "implied" locking scheme for locking records. All you need to do is start editing the record and it will be locked. You see, the BDE handles the locking for you. In this case, it's better to check for the existence of a lock once your user lands on a record using the BDE call DbiIsRecordLocked. Here's how:

var
  IsRecordLocked : Boolean;

DbiIsRecordLocked(Table1.Handle, IsRecordLocked);
if IsRecordLocked then
  ...do some stuff.
DbiIsRecordLocked checks for the existence of a record lock, then fills the Boolean input value with appropriate value.
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date