Developing Multi user application


I am working with Delphi 5 enterprise and sql server7.
I am using ADO components for database connection.

There will be 4 to 5 user accessing the data simultaneously.

What all things I have to do so that all users gets all data, but if any user edits a record then that record should be no editable for other users.

I have no idea about developing multi user applications, so please explain to me what all things I must to ensure the quality of this multi user process.

Who is Participating?
Mohammed NasmanConnect With a Mentor Software DeveloperCommented:

  there's a property of the ADO Table called LockType, and it have two values if you set it to  ltOptimistic then your record will lock when you call the post method, but if you set the LockType to ltPessimistic, then the record will lock when you edit the record

Best regards
hi dear,

if you write the code for appendding or updating the table using "table1.append," you must change this methode to write the commands using sql command for append or delete or update the table.

if you have problem with sql language i can send to you very simple example to your email.

thank you
princemaheshAuthor Commented:
Hi mnasman

I did that. I changed LockType to ltPessimistic but it still works in normal way.
It allows two user to edit and save the same records.

What I want to do is that if one user sets a record in edit mode then that record should be non editable for other users.

How can i get this work done?


Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

geobulConnect With a Mentor Commented:
In addition to mnasman's comment set:
CursorLocation := clUseServer;
CursorType := ctDynamic;

before opening the table.

Regards, Geo
princemahesh, I would ask you to reject slsl_93002's proposed answer as it is not really an answer.  Since it is now a proposed answer, your question is in the 'Locked Questions' section and is not likely to attract any more experts.

slsl_93002, it is not common practice to post an answer as a first response.  You should first post a comment, then if you've answered the question, princemahesh can accept your comment as an answer.  If at all possible, emails should be avoided as this is a knowledge sharing site.  An email from you to princemahesh does not help anyone else learn.  You can refer to this page to answer questions on etiquette (last section):
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if they are still open in 14 days.  Experts, please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.

To view your locked questions, please click the following link(s) and evaluate the proposed answer.

*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link 
POINTS FOR EXPERTS awaiting comments are listed in the link below
Moderators will finalize this question if in @14 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
Thanks everyone.
Moderator @ Experts Exchange
Hi Moondancer,
I still think that mnasman's comment together with my additions should solve princemahesh's problem.

Regards, Geo
I agree with geobul, setting the Cursor Location to the Server should solve the problem of locking records.
princemaheshAuthor Commented:
I aggre that setting those property will lock the record before posting.

But if suppose there are two users who are accessing the same record and one saves the changes first then when second user tries to save the record then system gives an error message that "The current reocrd has been updated sice you last read it."

Or suppose one user is modifing a record and other user deletes that record then again while saving that record first user will get the error.

Once this collaboration is completed and the additional "what if" question  is handled that Mahesh just posted, let me know.

I'll be happy to split points to award those who helped.

Moondancer - EE Moderator
princemahesh, what is the recordset's cursor location set to?  Client or server?  What is the Lock Type set to?

For your situation to be relieved, you will need to have the cursor location on the server and your lock type set to pessimistic.  Both properties must be present.  Also, make sure to check the cursor location after you have set the Active property to true as it will sometimes change the cursor location and type to whatever is available.
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.
Mohammed NasmanSoftware DeveloperCommented:
points to geobul  and me
I agree with mnasman, points to geobul and mnasman.
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.

All Courses

From novice to tech pro — start learning today.