Solved

Controling table refresing when inserting records

Posted on 1997-07-14
10
141 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
  • 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 100 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Filemaker 14 vs Delphi Embarcadero 7 185
Show Listview image from database (String field) 5 112
find a node in VST 2 63
JAudiorecorder record freezing the app 29 59
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
A short film showing how OnPage and Connectwise integration works.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

914 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now