Controling table refresing when inserting records

How can I keep a table updated for the users when records insertions occur and key duplication must be avoided?
Example: I have a medical calendar. Users want to set appointments for the same doctor on the same date. They check the calendar. The appointment doesn't exist yet. The first user sets the appointment. The second one should be able to see this in his screen. I've been trying the method 'refresh' but it doesn't work properly
thanks for advance.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Refresch only rereads record, but the first user don't write the
record to disk. Try set property CachedUpdates to false.
If this don't work you must tell more about Database especially
about property UpdateMode and UpdateObject.

"....For more infomation on updating read-only datasets, see the chapter on "Working with cached updates" in the Database Application Developer's Guide....."

Good Luck
anibalAuthor Commented:
If two users ,in a LAN, are inserting records with the same data at the same time how two avoid key duplication and how to keep th users informed when records are inserted?
You write  "...The second one should be able to see this in his screen. I've been trying the method 'refresh' but it doesn't work properly " so I say The first must save the record to disk, then the second can refresh !.
Key duplication if for you'r database engine.

I don't understand what you need.
Why Diversity in Tech Matters

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference ithrough the Colors of STEM program.

anibalAuthor Commented:
The problem is that the system is allowing insertion of identical records. I use Delphi 1.0 and I didn't find the method that you mentioned. Even using refresh before posting the record duplication occurs. I thought that bde would manage refreshing for all the station of the LAN when a table were edited.
Do you know how I could keep the users updated about the changes the tables suffer and how to avoid duplications of records when users try to insert 2 identical records at the same time?
Sorry for not being clear before.
Sorry I meen so i don't understand what you need (my english), but if i understand you must write code which check for duplication. You can do this in following sequence.

1.Try insert record
2. if duplication goto 4
3. All ok and goto END.
4. modify values which dulicates and goto 1.

If this is that what you want and you need code example then submit comment.
BDE can't do this for You.
Another way of doing this (as a reaction to mireks comment) is to  
1. insert an empty record with the date in question set.
2. post it.
3. open & lock it so the user in question can edit it.
4. post again.

When user A is adding an appointment this date is blocked and no other users can add another appointment for this date until user A finishes.
when you will use SQL and Interbase then you can do this in some other way's.
Hi anibal.

Sorry for my previous comment. I made mistake and this is not true.
BDE can do this for you.

The code is rather big so please get it from :
This is free component and with full source. It use BDE-Callbacks to refresh TTable or TQuery if the dataset get modified by another program.

ps. I think that this is what you need so i submit answer.



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
is anybody there?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.