Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Developing Multi user application

Posted on 2002-03-24
Last Modified: 2010-04-04

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.

Question by:princemahesh
  • 4
  • 2
  • 2
  • +4

Expert Comment

ID: 6893357
hi dear,

if you write the code for appendding or updating the table using "table1.append,table1.post" 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
LVL 22

Accepted Solution

Mohammed Nasman earned 50 total points
ID: 6893432

  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

Author Comment

ID: 6893498
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?


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.

LVL 17

Assisted Solution

geobul earned 50 total points
ID: 6896486
In addition to mnasman's comment set:
CursorLocation := clUseServer;
CursorType := ctDynamic;

before opening the table.

Regards, Geo

Expert Comment

ID: 6935924
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): http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp

Expert Comment

ID: 6975948
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.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

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
LVL 17

Expert Comment

ID: 7000587
Hi Moondancer,
I still think that mnasman's comment together with my additions should solve princemahesh's problem.

Regards, Geo

Expert Comment

ID: 7002270
I agree with geobul, setting the Cursor Location to the Server should solve the problem of locking records.

Author Comment

ID: 7005791
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.


Expert Comment

ID: 7035748
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

Expert Comment

ID: 7039910
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.

Expert Comment

ID: 9343225
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.
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 9387900
points to geobul  and me

Expert Comment

ID: 9389087
I agree with mnasman, points to geobul and mnasman.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question