Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

How To Make 1st Record in Table Get An ID Value of 1 as opposed to 0

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How To Make 1st Record in Table Get An ID Value of 1 as opposed to 0

    After creating a new table, lets say the ID field is 16 characters long and its auto incremented, How do I ensure the 1st record will get an ID of 1 and not an ID of 0?

    #2
    Re: How To Make 1st Record in Table Get An ID Value of 1 as opposed to 0

    Set default to 1
    Dave Mason
    [email protected]
    Skype is dave.mason46

    Comment


      #3
      Re: How To Make 1st Record in Table Get An ID Value of 1 as opposed to 0

      You said character 16....

      Make the default value in the fieldrules be space(15)+"1"

      otherwise if you make it "1", you'll run out of values after 35 entries: 1-9 then A-Z
      Al Buchholz
      Bookwood Systems, LTD
      Weekly QReportBuilder Webinars Thursday 1 pm CST

      Occam's Razor - KISS
      Normalize till it hurts - De-normalize till it works.
      Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
      When we triage a problem it is much easier to read sample systems than to read a mind.
      "Make it as simple as possible, but not simpler."
      Albert Einstein

      http://www.iadn.com/images/media/iadn_member.png

      Comment


        #4
        Re: How To Make 1st Record in Table Get An ID Value of 1 as opposed to 0

        Thanks Dave, I found that I must make it "0000000000000001" actually.

        I'm entering records via an Append Operation, after a few successful tests, I still ended up with a 1st record that got the 0 ID.
        Should I Enable the 2 check boxes labeled:
        1) Set default value at start of data entry
        2) At end of enter, set default value if field not touched by user

        ???

        Comment


          #5
          Re: How To Make 1st Record in Table Get An ID Value of 1 as opposed to 0

          I must have missed "the character" part. I rarely use other than numeric for the purpose.

          1&2 I would, but do not think it is really necessary.

          My users are very rarely going to see that number, and they cannot change it anyhow.
          Last edited by DaveM; 04-13-2016, 06:06 PM.
          Dave Mason
          [email protected]
          Skype is dave.mason46

          Comment


            #6
            Re: How To Make 1st Record in Table Get An ID Value of 1 as opposed to 0

            Dave, the Field rules works well when the record is entered manually, via a form, but when entered by an append operation, it works sometimes and not others, How can I ensure it always work?

            Comment


              #7
              Re: How To Make 1st Record in Table Get An ID Value of 1 as opposed to 0

              Originally posted by nigeldude View Post
              Dave, the Field rules works well when the record is entered manually, via a form, but when entered by an append operation, it works sometimes and not others, How can I ensure it always work?
              That is how field rules are designed to work.

              With an append operation, the field rules are ignored and the incoming value is used.

              So put the value you want in the transaction table and run the append.
              Al Buchholz
              Bookwood Systems, LTD
              Weekly QReportBuilder Webinars Thursday 1 pm CST

              Occam's Razor - KISS
              Normalize till it hurts - De-normalize till it works.
              Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
              When we triage a problem it is much easier to read sample systems than to read a mind.
              "Make it as simple as possible, but not simpler."
              Albert Einstein

              http://www.iadn.com/images/media/iadn_member.png

              Comment


                #8
                Re: How To Make 1st Record in Table Get An ID Value of 1 as opposed to 0

                Experience tells me that an append into an empty table will always create a record 0 with autoincrement. Suggest you add a dummy record before the append if an empty table then delete it after the append.

                Comment


                  #9
                  Re: How To Make 1st Record in Table Get An ID Value of 1 as opposed to 0

                  i do not have extensive experience on the desktop side, but i was curious about this append phenomenon.
                  if you have an empty table and need to use append operation when you design the operation remove the id field mapping then the append operation goes as you defined in the field rules, say starting value of some higher number than the "00000000".
                  i tested this theory twice and both times the value was correct using different starting point.
                  ( i used create rather than the create genie)
                  thanks for reading

                  gandhi

                  version 11 3381 - 4096
                  mysql backend
                  http://www.alphawebprogramming.blogspot.com
                  [email protected]
                  Skype:[email protected]
                  1 914 924 5171

                  Comment


                    #10
                    Re: How To Make 1st Record in Table Get An ID Value of 1 as opposed to 0

                    if your ai field is id and the incoming field is id2, just leave the ai2 out of the append. Then the field rules can do their job.
                    If you are wanting the values in id2 to be used, then remove the ai rule from id first, do the append and then put the ai rule back to id after. it will then go to the highest for the next ai when a field is entered.
                    Dave Mason
                    [email protected]
                    Skype is dave.mason46

                    Comment


                      #11
                      Re: How To Make 1st Record in Table Get An ID Value of 1 as opposed to 0

                      Auto_Id.zipHere is an example that shows some of the cause and effects of using auto increment and setting values.

                      Unzip the tables and add to a database/workspace sandbox you should have.

                      You can run the operations included to see what happens.

                      Then empty the target table and run the operations in a different order.

                      Note the #3 variation and what it does to the first time it's run versus subsequent times it is run.
                      Al Buchholz
                      Bookwood Systems, LTD
                      Weekly QReportBuilder Webinars Thursday 1 pm CST

                      Occam's Razor - KISS
                      Normalize till it hurts - De-normalize till it works.
                      Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                      When we triage a problem it is much easier to read sample systems than to read a mind.
                      "Make it as simple as possible, but not simpler."
                      Albert Einstein

                      http://www.iadn.com/images/media/iadn_member.png

                      Comment

                      Working...
                      X