Solved

Controling table refresing when inserting records

Posted on 1997-07-14
10
140 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 3

Expert Comment

by:mirek071497
Comment Utility
BDE can't do this for You.
0
 

Expert Comment

by:Wilfred
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Hi
is anybody there?
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

771 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

10 Experts available now in Live!

Get 1:1 Help Now