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

Index Tip?

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

    #46
    Re: Index Tip?

    Thanks Martin;

    Your code got me to thinking about index names and testing for truncation. This made me wonder whether it might even be a good idea to standardize the length of the index name across all user defined indexes? (ie: pad all index names with an underscore out to either 8 or 10 characters.) ~ This would allow you to add code to test for truncations & even "regenerate" (& save) the correct index names automatically in the unlikely event one becomes truncated.)

    Also, in the first script, usage of the "|" (pipe) characters are throwing me off.... example: "__A5_RECOR|RECNO()||"
    (I'm assuming that example above represents one of several ways the a5 generated indexes are represented/stored?)
    Last edited by SNusa; 04-23-2013, 09:35 AM.
    Robert T. ~ "I enjoy manipulating data... just not my data."
    It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
    RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

    Comment


      #47
      Re: Index Tip?

      Originally posted by SNusa View Post
      Thanks Martin;

      Your code got me to thinking about index names and testing for truncation. This made me wonder whether it might even be a good idea to standardize the length of the index name across all user defined indexes? (ie: pad all index names with an underscore out to either 8 or 10 characters.) ~ This would allow you to add code to test for truncations & even "regenerate" (& save) the correct index names automatically in the unlikely event one becomes truncated.)
      the rebuild function DOES rebuild to the original name, thats the whole point of the function
      Cole Custom Programming - Terrell, Texas
      972 524 8714
      [email protected]

      ____________________
      "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

      Comment


        #48
        Re: Index Tip?

        Originally posted by martinwcole View Post
        the rebuild function DOES rebuild to the original name, thats the whole point of the function
        Hi Martin;

        Yes, I hadn't gotten that far parsing the code on the second function. ~ I was thinking about the initial function as it generates the "backup table" of indexes. (and got hung up on usage of the "|" character) ~ I was thinking in terms of being able to automatically "catch" an unexpected, preexisting truncation and fix it (automatically) during the initial save.

        Without knowing the length of the index name, the first function is "blindly" assuming the state of the existing user generated indexes are fine, correct?
        (Hence making sure the indexes are not already truncated requires manual inspection without some sort of universal length "standardization".)
        Robert T. ~ "I enjoy manipulating data... just not my data."
        It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
        RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

        Comment


          #49
          Re: Index Tip?

          PS:

          while I don't recommend using the --- with padlefet, if you did you would want to pad right, not left - and they truncate after 10 characters, not 8
          Cole Custom Programming - Terrell, Texas
          972 524 8714
          [email protected]

          ____________________
          "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

          Comment


            #50
            Re: Index Tip?

            Originally posted by martinwcole View Post
            PS:

            while I don't recommend using the --- with padlefet, if you did you would want to pad right, not left - and they truncate after 10 characters, not 8
            Yes & thank you. For quite some time, I have adopted padding right with two underscores after using only the field name syllables. (Field "keyfob" becomes index "kyfb__".) ~ But I also had read elsewhere on this forum that some other issues regarding indexes can occur past the 8'th character. ~ I believe it was Ted Giles who made reference to experiencing this.
            Robert T. ~ "I enjoy manipulating data... just not my data."
            It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
            RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

            Comment


              #51
              Re: Index Tip?

              Martin,

              I set these functions up in my database and they work great until I try to access my database from a shadow. When trying to run it from a shadow, it gives an error on startup, 'tbl.tablename subelement not found' and will not load the database.

              If I run the database directly from the server, it runs fine.

              I've tried running the 'indexes_rebuild' directly from the server and running it from the shadow copy and still receive the above error either way.

              I did this with a backup copy, so no harm has been done but would like to be able to utilize this.

              Thanks

              Comment


                #52
                Re: Index Tip?

                hmmm - not sure what the issue is but I have been using that script for several years. It could be some of your tables are not in the same folder, (or in a subfolder.)
                Cole Custom Programming - Terrell, Texas
                972 524 8714
                [email protected]

                ____________________
                "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                Comment


                  #53
                  Re: Index Tip?

                  Originally posted by martinwcole View Post
                  hmmm - not sure what the issue is but I have been using that script for several years. It could be some of your tables are not in the same folder, (or in a subfolder.)
                  I've got it narrowed down to one table that is generating the error. I will try to figure out what it doesn't like and report back.

                  Thanks

                  Comment


                    #54
                    Re: Index Tip?

                    Martin, how do you accomplish the auto rebuild. Do not all users have to be out of the system? Is this setup on a ontimer event on an open form, or some other method?

                    Comment


                      #55
                      Re: Index Tip?

                      I put it as an option for some or all users, in a button
                      it will run whether others have the app open or not - and give a list of tables it could not rebuild

                      but mainly, I have a maintenance adb (in the same folder) that runs on the server from a windows task scheduler, that does various maintenance tasks, and then closes Alpha.
                      Cole Custom Programming - Terrell, Texas
                      972 524 8714
                      [email protected]

                      ____________________
                      "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                      Comment


                        #56
                        Re: Index Tip?

                        Ok... Here's what I have figured out while trying to implement these functions into my database...

                        If I run the application directly from the server, i can run the indexes_create() and indexes_rebuild() functions and everything works fine.

                        I can then create a shadow copy and it runs fine.

                        However, as soon as I rerun the indexes_rebuild() function, either directly from the server copy or from the shadow copy, my shadow copy is missing multiple indexes from multiple tables.

                        I can still load the app directly from the server and all of the indexes are in tact but the shadow copy is missing multiple indexes.

                        The only way I can get the shadow copy to run again is to delete it and recreate a new shadow. It will again run fine until I run the indexes_rebuild() again.

                        Make any sense?

                        Comment


                          #57
                          Re: Index Tip?

                          Hi Mark,
                          There shouldn't BE any index files (*.CDX) in the shadow folder.
                          Robin

                          Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                          Comment


                            #58
                            Re: Index Tip?

                            Some years ago I found that indexes were occasionally getting put on the workstation for certain clients. I don't recall the specific circumstances now but the exact same routine worked for must customers while causing a problem for one or two others. This is why the AIMS Index Rebuild addon now includes a routine to automatically remove any cdx files from the workstation unless the matching dbf file is not shadowed. The routine was originally created back in A5v5 so I have no idea what year or version the problems occurred. All I know is I haven't had any complaints since.

                            You might also want to change the test for __A5_Record__ indexes. I've often seen other names like __A5_Reco0, __A5_Reco1, etc. (Or maybe it was __A5_Rec01 and __A5_Rec02 - I'm not sure.) In fact, I once saw this go all the way up to __A5_Rec15. Also, that index should always be created. Again, I don't recall the issue but I've seen issues when that index was not rebuilt - rare but it has happened.
                            Last edited by CALocklin; 04-25-2013, 08:45 PM.

                            Comment


                              #59
                              Re: Index Tip?

                              Originally posted by MoGrace View Post
                              Hi Mark,
                              There shouldn't BE any index files (*.CDX) in the shadow folder.
                              That is the problem. When the indexes_rebuild() function is run from a shadow copy, it is writing the cdx files into the shadow folder instead of the main server folder.

                              If I manually move the cdx files from the shadow folder into the server folder, all is well again.

                              Comment


                                #60
                                Re: Index Tip?

                                I think the problem is that the create_indexes routine is not opening the table on the server. In my routine, I explicitly open the main data table - not the shadowed copy. Maybe the create_indexes() routine is supposed to handle the shadow issue internally but that doesn't seem to be happening. I know that plain a5.table_enum() does not include the path and I'm betting that a5.table_enum(1) would include the workstation path instead of the server path.

                                In fact, as I think about this more, that might be how I solved my original problem - by specifically opening the main data (server) table. The "remove indexes in the shadow folder" feature may have been a 'just in case'.

                                I notice now that the routine gets "mpath" and "datapath" but does nothing with them. That's kind of suspicious - and why two different variable names?
                                I use this in a LOT of scripts:
                                DIM datapath as C
                                IF a5.Get_Master_Path() = ""
                                datapath = a5.Get_Path()+chr(92)
                                ELSE
                                datapath = a5.Get_Master_Path()+chr(92)
                                END IF

                                Without copying the whole code and debugging it I'm not sure what happens but you should be able to make sure the full path and file name is included. If it still doesn't work, maybe there's an issue in the create_indexes() function that is ignoring the path.

                                Comment

                                Working...
                                X