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

Auto Increment problem

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

    Auto Increment problem

    I have searched the thread but there are answers that skirt this problem but none definitive. I have a field rule to auto increment. I want it to start at 1. For some reason it always sets the first record to 0. I have the simple default set to 1 and the skip to .t.. Is there something else that I am missing here.

    #2
    Re: Auto Increment problem

    You should make all autoincrement fields character not numeric.
    If you think you will never have more than 1000 records, I would set it to character 5 with field rules on 'Data-entry' tab 'Default mode' value set to 'Simple default expression' and 'Default value' set to '00001" and Skip set to true.
    Numeric fields are not indexed and also numeric fields should only be specified when you plan to do maths, add subtract, etc..
    Also note that the rule will not update existing records.
    Hope this helps.

    Comment


      #3
      Re: Auto Increment problem

      Interesting. I have only ever used numeric and kept it totally in the background where it cannot be touched

      Comment


        #4
        Re: Auto Increment problem

        Access defaults to numeric. Unfortunately Alpha lets you do some things that you later find can be problematic.

        Comment


          #5
          Re: Auto Increment problem

          Originally posted by Garry Flanigan View Post
          You should make all autoincrement fields character not numeric....
          This is highly debatable. Before ruling out using numeric fields you should peruse Bill Parker's post # 10 in this thread:

          http://msgboard.alphasoftware.com/al...ad.php?t=77116

          As I have said elsewhere, I have used both character and numeric fields for ID's and auto-increments in different apps for more than a decade and as near as I can remember (!) have never had a problem when I used numeric. And as the above thread indicates, as we move more into the SQL world there may be good reason to stay away from character ID's. Which I suppose may make your statement
          Unfortunately Alpha lets you do some things that you later find can be problematic.
          true but hardly in the way you were thinking.

          Raymond Lyons

          Comment


            #6
            Re: Auto Increment problem

            Maybe it is worth saying that I have not had a problem with autoincrement but do always use character and have no first hand experience with numeric.
            When I first started using Alpha, I read many posts and decided that the more knowledgeable members recommended character, so rather than re-invent the wheel I followed their advice.
            It is a pity that Alpha rarely provides input on these discussions. I spoke with Jerry Brightbill a couple of years ago about some design issues I had and it seems in some cases there is no definite answer.

            Comment


              #7
              Re: Auto Increment problem

              Originally posted by Garry Flanigan View Post
              Maybe it is worth saying that I have not had a problem with autoincrement but do always use character and have no first hand experience with numeric.
              When I first started using Alpha, I read many posts and decided that the more knowledgeable members recommended character, so rather than re-invent the wheel I followed their advice....
              Yeah, I read those posts too after I had already used numeric in a major app and I thought maybe some day I'll have some problem or another and will have to change to character. But after 10 years of heavy use in a networked, multi-user environment there never was a single issue. It's almost ironic that we will be switching to numeric as we move away from DBF to SQL tables (see the thread I referred to above).

              BTW, you certainly can index a numeric field.

              Raymond Lyons

              Comment


                #8
                Re: Auto Increment problem

                Originally posted by Raymond Lyons View Post
                BTW, you certainly can index a numeric field.
                You are correct Raymond.
                I should have been more specific.
                From the Help re LQO:
                Code:
                For Lightning Query Optimization to use a pre-existing index, the index must:
                Use at least one of the same fields used in the query.
                If you use multiple fields with different data types, the first field used must be type character,
                The data type of the data in the index key must match the data type of the field you are searching.
                So, as I understand it, if a field is numeric autoincrement and is concatenated in an index it is not used in LQO and must be separately indexed.
                Last edited by Garry Flanigan; 08-07-2009, 08:47 PM.

                Comment


                  #9
                  Re: Auto Increment problem

                  Originally posted by Mark Pearson View Post
                  I want it to start at 1. For some reason it always sets the first record to 0. I have the simple default set to 1 and the skip to .t.. Is there something else that I am missing here.
                  If you choose "set default at start of data-entry" it starts at 1, otherwise I also see that it starts as 0 - which it should not.

                  Comment


                    #10
                    Re: Auto Increment problem

                    Ray,
                    I do not wish to spark yet another debate on character vs numeric, but here is a couple more specifics that should be considered.

                    The web only uses character so if you are not needing to use SQL, character may be the better choice.

                    Numeric auto-increment fields also have a slight problem with the default starting value whereas Character auto-increment do not--see thread from this link where this was discussed. http://msgboard.alphasoftware.com/al...ent%2C+numeric

                    Like most things, much depends upon how a database is to be used.
                    Mike
                    __________________________________________
                    It is only when we forget all our learning that we begin to know.
                    It's not what you look at that matters, it's what you see.
                    Henry David Thoreau
                    __________________________________________



                    Comment


                      #11
                      Re: Auto Increment problem

                      Originally posted by MikeC View Post
                      Ray,
                      I do not wish to spark yet another debate on character vs numeric, but here is a couple more specifics that should be considered.

                      The web only uses character so if you are not needing to use SQL, character may be the better choice.

                      Numeric auto-increment fields also have a slight problem with the default starting value whereas Character auto-increment do not--see thread from this link where this was discussed. http://msgboard.alphasoftware.com/al...ent%2C+numeric

                      Like most things, much depends upon how a database is to be used.
                      Hi Mike,

                      It's not really a "debate" as far as I am concerned, except when someone states something like "make it this way or the sky will fall" when in fact the sky will not fall. I like having a choice and have used both character and numeric with no problems with either one. I vaguely remember one time having to turn off a numeric auto-increment and manually inputting a desired start number and then turning auto-increment back on--but I do not consider that to be a big problem even though there may be a bug as mentioned in the thread you referred to.

                      Good point about the web, just as the point about SQL is good to keep in mind. I have used SQL tables in an A5 app but have done nothing with A5 on the web. So here is a question: Are you saying that a SQL database that makes used of auto-incremented numeric fields could not be used in a web application? Any web application or just an A5 web app?

                      Ray Lyons

                      Comment


                        #12
                        Re: Auto Increment problem

                        Hi Ray,
                        Are you saying that a SQL database that makes used of auto-incremented numeric fields could not be used in a web application?
                        Not at all....except for the initial default glitch noted in the thread I gave a link for, it is just a matter of how much converting from character to numeric (and vise-versa) a person wishes to do, or more aptly, avoid.
                        Mike
                        __________________________________________
                        It is only when we forget all our learning that we begin to know.
                        It's not what you look at that matters, it's what you see.
                        Henry David Thoreau
                        __________________________________________



                        Comment


                          #13
                          Re: Auto Increment problem

                          Originally posted by MikeC View Post
                          .... it is just a matter of how much converting from character to numeric (and vise-versa) a person wishes to do, or more aptly, avoid.
                          Mike,

                          Being ignorant, I am still not sure I understand: Forgetting A5 for a moment, and given that almost all databases these days are SQL, are you saying all types of web app developers have to convert each and every numeric field in a SQL database to character before it can be used in a web app? If so, isn't that a bit lame? Or maybe not, as I guess web apps are all essentially text based documents, kind of like sticking a numeric in an RTF box. Hey, I really am ignorant when it comes to web apps. May have to do something about that--or die!

                          Ray Lyons

                          Comment


                            #14
                            Re: Auto Increment problem

                            Ray,
                            I am probably as ignorant as you are regarding the Web side of things...but have been learning of the many nuances so that I can jump in when the time is right.....this thread link pretty much covers it http://msgboard.alphasoftware.com/al...racter+numeric where Steve Wood states in post 2:

                            I think numeric is fine for hidden keys provided you are not going to take your application to the web. In the web EVERYTHING is a character, even your numeric fields. That means you constantly have to convert them in code when they are used on the web. That rule is not everywhere, so that makes it worse, having to figure out when you need to convert, when you don't.
                            Mike
                            __________________________________________
                            It is only when we forget all our learning that we begin to know.
                            It's not what you look at that matters, it's what you see.
                            Henry David Thoreau
                            __________________________________________



                            Comment


                              #15
                              Re: Auto Increment problem

                              Thanks Mike.

                              I was involved in that thread so I should have remembered the contribution you quoted (Steve's), not just Bill Parker's (which I did remember).

                              Ray

                              Comment

                              Working...
                              X