Alpha Video Training
Results 1 to 10 of 10

Thread: Auto Increment Field Rule

  1. #1
    Member
    Real Name
    Andy Sigrist
    Join Date
    May 2000
    Location
    Vancouver, BC, Canada
    Posts
    130

    Default Auto Increment Field Rule

    Is there an X-Basic command to turn the auto-increment field rule for a field on and off ?

    Thanks

    Andy Sigrist

  2. #2
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: Auto Increment Field Rule

    I don't think so. -- tom

  3. #3
    Member SwissCharles's Avatar
    Real Name
    Charles U. Schneiter
    Join Date
    Apr 2003
    Location
    Basel, Switzerland
    Posts
    181

    Default RE: Auto Increment Field Rule

    Why would you want to do this?

    Charles

  4. #4
    Member
    Real Name
    Andy Sigrist
    Join Date
    May 2000
    Location
    Vancouver, BC, Canada
    Posts
    130

    Default RE: Auto Increment Field Rule

    I am planning to archive old Work Orders to a secondary DBF file.

    Another routine would allow the user to recombine (re-append) the archived records back into the Work Order file.

    If the autoincrement is left on, the archived Work Orders will be given new Workorder numbers during the append session.

    If I can turn off the autoincrement during the append operation, I can recombine them while preserving the original Work Order numbers

    Andy

  5. #5
    VAR
    Real Name
    Cheryl Lemire
    Join Date
    Jul 2003
    Location
    Pembroke Pines, FL
    Posts
    2,914

    Default RE: Auto Increment Field Rule

    Hi Andy,

    This may be the long way around accomplishing what you need, but if you do not get any other options from other people here, you could give it a try.

    Copy the entire table to a new table, then delete records from your copy based on a range of workorder numbers. I believe this will give you the end result you are looking for.

    Cheryl

  6. #6
    Member SwissCharles's Avatar
    Real Name
    Charles U. Schneiter
    Join Date
    Apr 2003
    Location
    Basel, Switzerland
    Posts
    181

    Default RE: Auto Increment Field Rule

    Andy,

    This may touch on more philosophical aspects than technical ones.

    For a start, I would refrain from shuffling records back and forth just to indicate their changed status (from 'active' to 'archived').

    If I get you right, you want to 'archive'certain work orders but be able to 'un-archive' some of them at a later time while preserving their original work order numbers.

    In similar circumstances I would just add a field to the work orders table called 'WO_Status' containing choices like 'active' 'inactive' 'investigate' and some such, you get the idea.

    Then, by just setting a view-filter on the value of the 'staus' field according to the records you want to see (being in the form of a script in a button or a predefined filter in a forms property, etc), you get all the records you do not want to see easily out of your way. Un-archiving a record then becomes the simple matter of changing the value in the 'status' field.

    This solution is also more in line with relational theory...

    HTH

    Charles


  7. #7
    VAR
    Real Name
    Martin W. Cole
    Join Date
    Apr 2000
    Location
    Terrell, Texas (near Dallas)
    Posts
    5,957

    Default RE: Auto Increment Field Rule

    Andy, I have that scenario in a couple of situations, as the table otherwise becomes too large.

    My approach is to use a roll-your-own autoincrement, and it then never beecomes an issue.

  8. #8
    Member
    Real Name
    Andy Sigrist
    Join Date
    May 2000
    Location
    Vancouver, BC, Canada
    Posts
    130

    Default RE: Auto Increment Field Rule

    So far I used to "archive" records just based on their status like suggested in an earlier message. But like you mention, in time the files just get too large.

    For this reason, I decided that I do want to split them off physically into a different DBF now.

    I may have to go to my own auto-increment routine as well. On the other hand, I thought there should be an X-Basic command to turn the auto-increment on and off. After all there are commands to set all kind of other field properties on forms through X-basic.

    Thanks for your help

    Andy

  9. #9
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: Auto Increment Field Rule

    Andy,

    I don't think there are any field rules that can be enabled or disabled using xbasic scripts. My guess is that this is by design. They are intended to work regardless of which form or browse layout is being used to edit records in the table. Unlike field object properties in your form they are not tied to a particular form.

    -- tom

  10. #10
    Member SwissCharles's Avatar
    Real Name
    Charles U. Schneiter
    Join Date
    Apr 2003
    Location
    Basel, Switzerland
    Posts
    181

    Default RE: Auto Increment Field Rule

    Andy,

    When you write: "But like you mention, in time the files just get too large."

    These are genuine questions:
    How does this manifest itself?
    How large is 'too large'?
    Are you talking about fetch-times?
    How many records do you have in said table and how many fields per record?
    How are the indexes set up?

    Charles

Similar Threads

  1. field auto increment
    By Josh Curtis in forum Web Application Server v6
    Replies: 0
    Last Post: 05-02-2005, 04:09 PM
  2. Adding auto-increment field
    By Brian Timm in forum Alpha Five Version 5
    Replies: 3
    Last Post: 12-18-2004, 01:34 PM
  3. Auto Auto-Increment Field
    By Ken McEntee in forum Alpha Five Version 5
    Replies: 8
    Last Post: 05-12-2004, 01:12 PM
  4. Auto increment ID field
    By Jimmy Davis in forum Alpha Four Version 6 and Prior
    Replies: 0
    Last Post: 07-07-2003, 06:33 PM
  5. AUTO INCREMENT FIELD
    By Mary ellen decker in forum Alpha Five Version 4
    Replies: 5
    Last Post: 09-26-2000, 08:07 PM

Bookmarks

Posting Permissions

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