?
Solved

Controling table refresing when inserting records

Posted on 1997-07-14
10
Medium Priority
?
146 Views
Last Modified: 2010-04-06
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.
0
Comment
Question by:anibal
[X]
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
  • 7
  • 2
10 Comments
 
LVL 3

Expert Comment

by:mirek071497
ID: 1338887
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
Mirek
0
 

Author Comment

by:anibal
ID: 1338888
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?
0
 
LVL 3

Expert Comment

by:mirek071497
ID: 1338889
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.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:anibal
ID: 1338890
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.
0
 
LVL 3

Expert Comment

by:mirek071497
ID: 1338891
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.
0
 
LVL 3

Expert Comment

by:mirek071497
ID: 1338892
BDE can't do this for You.
0
 

Expert Comment

by:Wilfred
ID: 1338893
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.
0
 
LVL 3

Expert Comment

by:mirek071497
ID: 1338894
when you will use SQL and Interbase then you can do this in some other way's.
0
 
LVL 3

Accepted Solution

by:
mirek071497 earned 200 total points
ID: 1338895
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 :
http://sunsite.icm.edu.pl/delphi/ftp/d10free/refresh.zip
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.

Regard's
Mirek

0
 
LVL 3

Expert Comment

by:mirek071497
ID: 1338896
Hi
is anybody there?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month12 days, 9 hours left to enroll

777 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