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

tbl pack question

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

  • tbl pack question

    I have two tables that will compact fine when done in the control panel. When they are compacted in code, for one of the tables I keep getting the message that the index cannot be packed/rebuilt for the dictionary. Then the message - compact complete. The other table no such message/problem. Any ideas or is this to vague. ?

  • #2
    Re: tbl pack question

    James,
    How is the code implemented??
    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


    • #3
      Re: tbl pack question

      Originally posted by milesjg View Post
      When they are compacted in code, for one of the tables I keep getting the message that the index cannot be packed/rebuilt for the dictionary. ?
      This generally means that the table is open/in use. As Mike asks, what is the context? Does your code run from a button on a form based on the problem table?

      Many users will create a table with one field and one record which is used for nothing other than a basis for "manu" forms. These forms contain buttons initiating code that operates on other tables where exclusive use is critical to the code.
      There can be only one.

      Comment


      • #4
        Re: tbl pack question

        Thanks for the replies.

        - Yes the code runs from a button on a form.
        - I update the indexes.
        - I closed the form and the database. (a5.database.close()).
        - Change directories and load another database. (Nothing else)
        - Then use a5.pack_tables.
        -If I place the pack_tables anywhere before loading another database I get the table in use message.
        The form being closed is extremely "delete record intense" so I thought it would be a good idea to pack the tables on exit to prepare for the next session. This works for one of the tables, but the other gives the error message. The table giving the messge is a master linked to the table which goes ok. As mentioned I can compact the db from the control panel, which I don't know if has what to do with the packing.

        Comment


        • #5
          Re: tbl pack question

          James,
          :confused: Really confused now--read, reread your post. :confused:

          Two comments--

          1...how can you pack tables of a closed database??? Am I unaware of this aspect of Alpha?? How would Alpha know which tables to pack??? As far as I know these things cannot be done so are said rhetorically...unless.... :)

          2...I will say again what Stan mentioned. The only tables that will be packed are ones that are not open...whether it is due to a form or browse based on the table, a set that is open that contains the table or simply a form (a dialog one especially), table, or set not closed properly.

          You say the pack tables script is called from a button. Is this button on a form/browse that is based on the table that won't pack? If so, then makes sense and there is NO way to correctly pack the table while it is still open. What to do? Just as Stan said...pack the table from a different form (that is based on a different table knowing that the table this form is based on will not get packed).
          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


          • #6
            Re: tbl pack question

            Well, it do not suprise me. I confuse myself most of the time anyway. But here is what I did. It is attached as a txt file. The database being closed is the one with the tables to be packed. This generates a error when the general table is packed.

            Comment


            • #7
              Re: tbl pack question

              ok James.
              A fairly unusual method undoubtably. Once the DB is completely open go into File-->Database Properties and see if any tables are open...are either of the two tables you are trying to pack listed as being open?? If so then maybe your script which does not explicitly close the tables may be the reason...even though you would think they would close with the DB close you did I have many times witnessed the fact that tables can remain open even if the DB is not. Just a thought.
              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


              • #8
                Re: tbl pack question

                Originally posted by milesjg View Post
                Well, it do not suprise me. I confuse myself most of the time anyway. But here is what I did. It is attached as a txt file. The database being closed is the one with the tables to be packed. This generates a error when the general table is packed.
                Could it be that after you opened the tables in your script and updated their indexes, you did not close them?


                Code:
                tbl1 = table.open("genaccts")
                tbl1.update_production_index()
                tbl1.close()
                sleep(.15) 'give it some time to finish
                
                tbl2 = table.open("general")
                tbl2.update_production_index()
                tbl2.close()
                sleep(.15)
                
                parentform.close()
                sleep(.15)
                
                a5.Database_Close()
                
                file.dir_put("c:\Estimate")
                
                :a5.load("c:\Estimate\Screens.adb")
                
                a5_pack_table("c:\estimate\setup\general accounts\general.dbf")
                a5_pack_table("c:\estimate\setup\general accounts\genaccts.dbf")
                
                Form.view("SETUP OPENING SCREEN")
                The help is not very clear whether the new a5_pack_table() opens the table in order to pack it or not and then closes it. The old <tbl>.pack() command needed to point to an open table.
                Last edited by MoGrace; 04-11-2008, 12:50 AM.
                Robin

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

                Comment


                • #9
                  Re: tbl pack question

                  1. If you go to the controlpanel of a database, and try to pack a table, and it replies the table is in use, generally that means you left it open somewhere. (One thing to look at though is whether you have been using operations for the table before you tries to pack - as in any other event since the last time you opened the data base. Not sure if the issue is still around, but there was a point when operations would sometines not close a table, and developers were converting the operations to xbasic - which eliminated the problem.)

                  2. a5.load("c:\Estimate\Screens.adb") automatically closes the current adb before opening the next one, so closing it is not only unnecessary but could cause problems.

                  3. If you use a5_pack_table("c:\estimate\setup\general accounts\general.dbf") you do not need to open the tables first. And you do not need to rebuild the indexes, as this not only removes deleted records but also refreshed the indexes.
                  Cole Custom Programming - Terrell, Texas
                  972 524 8714
                  martin_w_cole@msn.com

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

                  Comment


                  • #10
                    Re: tbl pack question

                    Even if tbl.close() is used the tables are still open. By running debug before the code and stepping through, the isopen() shows the tables open untill another db is loaded.

                    tbl.close()
                    parentform.close()
                    a5.database_close()
                    ' change directory
                    ' load another db.

                    In debug isopen() and in_use() show tables as open until after the load another db occurs.
                    The genaccts table presents no problem. Just the other one. It has to have something to do with it being a master in a link. Although I did create another set and both tables had no problem. Must be the table. Will delete and remake it. Thanks for the interest.

                    Comment


                    • #11
                      Re: tbl pack question

                      Martin;

                      There are no operations being run on the tables prior to running this code segment. There will be in actual use,but I have'nt touched the tables while trying to resolve this.
                      The reason I redid the indexes was that both tables gave me the error message until I did. (This was after running operations on the tables) After the redo on the index no problem. So I left it in. I opened the tables prior to the a5_pack, but issued the tbl.close() before the form was closed, which did not close the tables (isopen in debug show .T.) I put the a5_db_close in a attempt to close the tables (which did not work) so as to run the packing before the next db was loaded.

                      Comment


                      • #12
                        Re: tbl pack question

                        ok - it sounds like the issue is in the operations.
                        Do this:

                        Open the adb fresh, and do a database compact.

                        If all tables pack ok - go to the index definitions for those tables and see if all the indexes still exist. (Historically - an impossible query would cause Alpha to actually delete an index, and operations typically include a query/filter.)

                        If all the tables don't pack ok - close the adb and then open it again, and try it again.

                        If they don't all pack - then you have a different issue.

                        If they do - do whatever you do that has the operation(s) run. Go to the control panel, and see if the tables will pack, and the indexes are still there.

                        added PS: be sure the form where you are running the indexrebuild/table pack from IS NOT bases on any of the tables in question or a set including same.
                        Cole Custom Programming - Terrell, Texas
                        972 524 8714
                        martin_w_cole@msn.com

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

                        Comment


                        • #13
                          Re: tbl pack question

                          Mike, just for the record, you CAN open tables in adb "B" from adb "A" and do basically anything you want. I have a scenario where there are about 10 different adbs on a server - one each for individual hospitals/clinics/living centers, etc. And from a separate adb that runs nightly at a specified time does maintenance on each of the 10 adbs - all are in their own folders.
                          Cole Custom Programming - Terrell, Texas
                          972 524 8714
                          martin_w_cole@msn.com

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

                          Comment


                          • #14
                            Re: tbl pack question

                            Martin, nice to know! I imagine that you just have to use the complete path to the unopened DB when referencing any table within the unopened application/database then.

                            Anyway--one thing not asked or mentioned is --is the form causing the problem by chance opened as a dialog form?? So many times this is the cause of a table being left open.
                            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: tbl pack question

                              a seperate adb with those tables mentioned to be packed and a dummy table(that does not get packed) and form with the button can solve all of this. Open the extra adb, only the dummy table will be open, run the pack operation on all the tables and close the adb.

                              It can also be set up as automatic with the autoexec script in the seperate adb so there is no form. This can be run after the main adb is closed with an ondatabaseclose script.

                              This is in theory.

                              I rarely have to pack tables, but start the adb with a form on a table that has one record only. any packing is done from here. Once tables are opened and worked with, it will not run(sets a var to .t. so the pack button does nothing)
                              Dave Mason
                              dave@aldadesktop.com
                              Skype is dave.mason46

                              Comment

                              Working...
                              X