Alpha Video Training
Results 1 to 4 of 4

Thread: Why do records get lost or changed?

  1. #1
    Brett Heintzman

    Default Why do records get lost or changed?

    I have designed an Alpha 4.5 database for a camp. The main table of the database is where the camp intake dept. enters all of the camper information from their application. Once the camper has been accepted, they use a set I developed to bring in the camper's information, then assign them a camp session. There are three tables involved... 1)Camper data... 2)Session Data.... and 3)Session Dates. In the set, SESSION DATA is the parent table. CAMPER DATA is a one-to-many link child table with "prevent changes" that links on a camper ID number which is auto-increment and unique. SESSIONS DATES is a one-to-one link.

    Here's the problem. The client is calling me often with small problems. 1) A camper will just disappear from the session data after being entered. Usually when I follow up the camper's number will have been replaced by another's. This was happening before and someone suggested changing my one-to-one link to a one-to-many link and still the same result.

    Second, Sometimes the auto-increment feature on the CAMPER DATA table for the camper ID does not work. One day it got stuck on a certain number and would not continue til they shut everything down and restarted.

    As a final note, you should know that it is running on a network with an NT Server and Win98 workstations. They have as many as three people at a time entering data into the CAMPER DATA section. Could there be issues here?

    Any help you could offer would be very much appreciated. I have tried to resolve this problem and seem to get nowhere. Thanks in advance for any help you can offer.

  2. #2
    Real Name
    Barry Rochford
    Join Date
    Apr 2000

    Default RE: Why do records get lost or changed?

    I have a POS Application where my primary Link field is an Auto increment field. Remember when you press "New Record", Alpha assigns the number from the latest record that is in the table + 1 as the "Potential new Auto increm. Value", when you save the record, it then becomes the "Actual new Auto. Increm. Value". On a network, you have to be smarter than the average Bear when multiple work stations can be entering new records.

    Here is a suggestion you can try. On your Main Menu you probably have a selection "Create new Happy Camper". When you press this button, immediately, create the new record which will contain the Auto. Increm field (plus anything else needed, such as Curr. Date, etc. Then save the record number and call in the "New Happy Camper" form displaying the information from the record you just created (probably the Auto. increm number and "date entered") and the operator can then fill in the remaining data.

    Otherwise it is very likely if you and I both press new record at the (almost) same time, we could both see the exact same "Potential new Auto. Increm. Value". Whoever saves the record first is the winner. The loser gets the next number.

    You can test this yourself by calling in the "New Happy Camper" form -press new record and look at the auto increm number, then minimize that form and call in another instance of the form, press new record and see what auto. increm number it shows.


  3. #3
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000

    Default RE: Why do records get lost or changed?

    Brett, it's not possible to offer specific advice without being able to see the application.

    If data entry is occuring within the context of a set, only the parent table should be assigning unique camper numbers using the autoincrement field rule. In all probability that field should be used to link to the child table records.

    If you also have an autoincrement field rule active in a related child table that rule will determine the next camper number based on the last record added to the child table, instead of the last number added to the parent table. It's better to let the set assign the parent's camper number to each new child record. Otherwise, as new child records are added, they get different camper numbers and the link to the parent record is lost immediately. In my work here for the link field in related child tables I set 'skip' true so the user can't edit it, also. However, I'm careful not to have two separate autoincrement field rules active (one for parent table of the set, and a second for the child table of the set)... that way leads to madness.

  4. #4
    Former Alpha Employee JerryBrightbill's Avatar
    Real Name
    Jerry Brightbill
    Join Date
    Apr 2000

    Default RE: Why do records get lost or changed?

    To expand on Tom and Barry's comments, another approach is to develop your own autoincrement rule. I have a set where both the parent and child records need ID numbers assigned using some form of autoincrement. Since the parent ID links the child records, that ID is more critical. What I do is assign the ID when the parent is saved. In the CanSaveRecord event in field rules, I fist determine if the record is in enter or change mode using mode_get(). Then I find the next possible number using the tablemax() function and add 1. This becomes the new link field and reduces the possibility of conflicts.

    Another approach is to create a table which saved the last number used. When you need the next number, open the table, add 1 to the existing value and save the new number to both the parent table and the table holding the last value. I have used this approach too, but find the first method easier.


Similar Threads

  1. Handle new and changed records concept
    By Sieward in forum Alpha Five Version 6
    Replies: 0
    Last Post: 10-03-2005, 06:26 AM
  2. Records won't accept changed data
    By C D Croscutt in forum Alpha Five Version 6
    Replies: 2
    Last Post: 01-11-2005, 06:41 AM
  3. Changed records not saving
    By MIKE LYON in forum Alpha Five Version 4
    Replies: 3
    Last Post: 07-10-2002, 06:00 PM
  4. Changed records
    By Keith Hart in forum Alpha Five Versions 2 and 3
    Replies: 0
    Last Post: 11-27-2001, 02:48 AM
  5. Lost Records Sometimes
    By Bruce MacPherson in forum Alpha Five Version 4
    Replies: 5
    Last Post: 03-29-2001, 05:23 PM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts