Alpha Video Training
Results 1 to 4 of 4

Thread: Auto Increment- property to turn on and off

  1. #1
    Member
    Real Name
    Donald Raymond
    Join Date
    Jul 2000
    Location
    Long Island, NY
    Posts
    153

    Default Auto Increment- property to turn on and off

    I would like to put a password protected button on a form that would allow me to turn auto increment for a field off, allow me to make a change to that fields value, save the record, and then turn the auto increment for that field back to on. Is there a way I can change this field rule with xbasic?

    Thanks,
    Don

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Auto Increment- property to turn on and off

    Turn off auto increment and set to user entered, field named sysid, tablename test.

    Code:
    tbl = table.open("test")
    rul = tbl.rules_get()
    rul.change_begin()
    rul.sysid.data_type = "User"
    rul.sysid.Default.Default = ""
    rul.sysid.Default.Type = "None"
    rul.change_end(.t.)
    tbl.close()
    Turn on auto increment same field and table.

    Code:
    tbl = table.open("test")
    rul = tbl.rules_get()
    rul.change_begin()
    rul.sysid.data_type = "AutoInc"
    rul.sysid.Default.Type = "Simple"
    rul.sysid.Default.Default = quote("00001") '<-change this to whatever your real default might be
    rul.change_end(.t.)
    tbl.close()
    There can be only one.

  3. #3
    Member
    Real Name
    Donald Raymond
    Join Date
    Jul 2000
    Location
    Long Island, NY
    Posts
    153

    Default Re: Auto Increment- property to turn on and off

    Thanks for the quick reply Stan, I will give it a try.

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Auto Increment- property to turn on and off

    And the results were?
    There can be only one.

Similar Threads

  1. dbf to sql - how to set auto increment
    By richard2007 in forum Application Server Version 11 - Web/Browser Applications
    Replies: 6
    Last Post: 07-09-2013, 06:49 AM
  2. how to turn off auto /div
    By leec2000 in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 04-05-2011, 05:47 AM
  3. Turn off Auto-Increment on the fly?
    By Rich Hartnett in forum Application Server Version 9 - Web/Browser Applications
    Replies: 3
    Last Post: 09-09-2008, 07:25 PM
  4. how to turn off auto-complete everywhere
    By Robert Davis in forum Alpha Five Version 5
    Replies: 0
    Last Post: 12-06-2004, 04:06 AM
  5. Auto Auto-Increment Field
    By Ken McEntee in forum Alpha Five Version 5
    Replies: 8
    Last Post: 05-12-2004, 12:12 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
  •