• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 437
  • Last Modified:

Delphi - how to make a program multi-user

Hi, Experts,

I've been given some Delhi 5 code that needs to be made lightly multi-user. So rather than one person inputing data maybe three could.
We are using the BDE with Paradox tables.

Could someone point me in the direction of the calls and approach to lock/query/unlock and backoff with this combination in Delphi?

With thanks,

Ed
0
edhasted
Asked:
edhasted
  • 4
  • 3
2 Solutions
 
moorhouselondonCommented:
From: http://info.borland.com/devsupport/bde/bdeapiex/

# DbiAcqPersistTableLock: Acquires an exclusive persistent lock on the table preventing other users from using the table or creating a table of the same name.
# DbiAcqTableLock: Acquires a table-level lock on the table associated with the given cursor.
# DbiGetRecord: Record positioning functions have a lock parameter.
# DbiIsRecordLocked: Checks the lock status of the current record.
# DbiIsTableLocked: Returns the number of locks of a specified type acquired on the table associated with the given session.
# DbiIsTableShared: Determines whether the table is physically shared or not.
# DbiOpenLockList: Creates an in-memory table containing a list of locks acquired on the table.
# DbiOpenUserList: Creates an in-memory table containing a list of users sharing the same network file.
# DbiRelPersistTableLock: Releases the persistent table lock on the specified table.
# DbiRelRecordLock: Releases the record lock on either the current record of the cursor or only the locks acquired in the current session.
# DbiRelTableLock: Releases table locks of the specified type associated with the current session (the session in which the cursor was created).
# DbiSetLockRetry: Sets the table and record lock retry time for the current session.
0
 
moorhouselondonCommented:
With Ttable, there is

tt.locktable(ltWriteLock);
tt.unlocktable(ltWriteLock);
0
 
edhastedAuthor Commented:
Guess what I'll be trying out today...
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
moorhouselondonCommented:
Make sure that inserting records near simultaneously is handled correctly - are you generating sequential ID numbers, or are you using Paradox autoincrement field?  (Autoincrement is probably more reliable, but cannot be controlled).  Don't forget that the NETDIR setting in the BDE needs to be setup too.  Good luck.
0
 
edhastedAuthor Commented:
I always have an auto-increment field in any table :-). The last time I did any MU coding was in the early editions of Paradox - many thanks for all your advice - here goes...

Ed
0
 
Mohammed NasmanSoftware DeveloperCommented:
read this article


Paradox: A Cheap Alternative to Client/Server?
http://www.syntap.com/articles/
0
 
edhastedAuthor Commented:
mnasman - that's a salutary article which was a useful reminder - thanks.

With MoorHouseLondon's comments most of the BDE help examples seem to be based around cursor positions. All very useful if you're looking at a DBGrid.

I have a form of data filled in and I want to be able to lock the file, insert and unlock (having tested it first).
Or when I am working with known record numbers lock that record number and then unlock it.

Are there any examples which are not cursor dependent?

Many thanks,

Ed
0
 
edhastedAuthor Commented:
moorhouselondon and msasman,

thank you for your prompt and useful support. In reading your replies I think the real issue was that I had not provided adequate information when forming my question, so expect some more explicit follow ups.

With many thanks for your help,

Ed

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now