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

Can't ZAP File - In Use

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

    Can't ZAP File - In Use

    Frustrating and normally, that means an easy answer.

    The files: File1 and File2.
    --------------------------------------------
    I identified records for selection within File1
    ZAP File2
    Append selected records (File1 -> File2)
    Zap File1
    Append File2 to File1

    Sounds simple enough. BUT, the ZAP on File1 says I can't do it because the file is in use. UNLIKELY as no one else is on my development laptop.

    Help...

    Lar

    #2
    Re: Can't ZAP File - In Use

    close file 1, then try the zap.

    Comment


      #3
      Re: Can't ZAP File - In Use

      Tried issuing a table.close but didn't help.

      Also, I have an operation that posts a logical field for selection. If I work that operation into the script, it fails. If I omit the post and run the script from outside the menu, i.e. - call it from the Control Panel, seems to work fine.

      How can I force the file to close I guess is the question.

      Lar

      Comment


        #4
        Re: Can't ZAP File - In Use

        Convert the "operation that posts a logical field for selection" to xbasic and then add a TABLE.close() at the end of the script. Note that you substitute the pointer name as used in the script for TABLE.
        Operations often leave tables open, but in your case why the script works from Control Panel but not from a button is strange.
        Also, from what you indicate, have you considered an xdialog to allow selection of the county (as mentioned in your other post)?

        Comment


          #5
          Re: Can't ZAP File - In Use

          How to find out different pointer of a table if opened more than once? I do also find difficulties in zap-ing a file!
          Renny
          Last edited by jacobr; 05-02-2012, 12:26 AM. Reason: correction

          Comment


            #6
            Re: Can't ZAP File - In Use

            This thread makes me cringe. Let's try and use the correct language so we are clear on what is needed.

            You zap TABLES not FILES. FILES are either created, appended or removed/deleted. Database TABLES are zapped ( or emptied). Is that what you are trying for Renny?
            Mike W
            __________________________
            "I rebel in at least small things to express to the world that I have not completely surrendered"

            Comment


              #7
              Re: Can't ZAP File - In Use

              Also one of the primary reasons a table isn't zapped is when the code is called from a form/browse that is bound to the table (or set that contains the table).

              Therefore the table is open and you ain't gonna close it..

              Hence the suggestion to use an xdialog, toolbar, or menu item that isn't bound to a table/set.
              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: Can't ZAP File - In Use

                To close all open tables for any .dbf application, this should work when run from the IW, but it doesn't!
                ~There may be a bug in the enum_open() method?

                According to the wiki:
                The TABLE.ENUM_OPEN() method returns a character string containing information about open tables.

                Code:
                dim vc_OpenTableList as C
                debug(1)
                'ON ERROR RESUME NEXT    'some tables are presumably internal, and can't be closed...  This gets around the problem.
                vc_OpenTableList = TABLE.enum_open()    'get list of tables
                msgbox("vc_OpenTableList")    'show OPEN tables...
                for each item in vc_OpenTableList    'loop through tables
                     TABLE.GET(item.value).close()    'use table pointer (without assigning a variable to the pointer) to close table.
                          ' (these two lines below are the same as one line above)
                          ' dim vp_Table as P = TABLE.GET(item.value)    'this line gets pointer to table.
                          ' vp_Table.close()    'close OPEN table ~ PROBLEM HERE.....
                next
                'now zap that table!
                The problem appears to be: Some of the user (enumerated / "open") tables (reported as open by enum_open() are not actually open!?!?

                Example, try this: (Using any existing database containing .dbf tables).....

                1. Copy the code above into the IW.
                2. Double click on any .dbf table (to open a default browse, open a few tables by double clicking on the table if you wish)
                3. Now go back to the IW and run the code from there.
                4. Notice that the msgbox() indicates these table enumerate as open. (enumerated in list)
                5. Set a watch variable (in the debugger) to item.value. (so that you know when you are on the tables you opened in the browses)
                6. Trace through the code.
                7. When TABLE.GET(item.value).close() attempts to close these "open tables" (listed in enumerated list) a [no table found] error is displayed....

                Problem -> Tables show as open from vc_OpenTableList = TABLE.enum_open() but TABLE.GET(item.value).close() indicates error of [no table found].

                Question: Are the tables really open in the first place? Or is enum_open() incorrectly reporting them as open tables since they are being displayed in the browse......???

                PS: I know some of the tables that enum_open() returns are internal a5 tables. (That's why I had added the ON ERROR RESUME NEXT code...... I remmed it out to step through the code. When you first get to these "internal tables" you'll have to hit "skip" in the debugger, as they re at the top of the list.)

                Also, if you open the tables using table.open("TableName") these tables are closed correctly. (So the code is closing tables as expected.) It's apparently just being fed incorrect information from the enum_open() method. ~ If that makes sense....

                RSVP ~ Aaarrrgh!
                Last edited by SNusa; 05-03-2012, 02:10 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


                  #9
                  Re: Can't ZAP File - In Use

                  Hi Robert,

                  Originally posted by SNusa View Post
                  ~There may be a bug in the enum_open() method?
                  Extremely doubtful.

                  There are 2 problems I see. First, you are using the for each construct which returns a pointer. This may not be the best way because of the following line


                  TABLE.GET(item.value).close()

                  If you had done it like

                  ptr=table.get(item.value)
                  ptr.close()

                  that might be better. In some cases, such as DIM, it does not evaluate the leading part as an expression. Better to build the pointer in pieces than place an expression as you have if you are not sure. In Active X, only one level of pointer is supported in the parameters, so build a pointer to the variable space and use that as an intermediate pointer.

                  Also, since the for each is a language construct (not a function, but built into the language), then it's usage of the item.value pointer may also be a bit odd. Using item by itself may have been better. Alternatively, I would have used a for next loop, and just take each line of the text. That would eliminate any possible oddities.

                  I don't have time to try it right now, so you can play with those ideas.
                  Regards,

                  Ira J. Perlow
                  Computer Systems Design


                  CSDA A5 Products
                  New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                  CSDA Barcode Functions

                  CSDA Code Utility
                  CSDA Screen Capture


                  Comment


                    #10
                    Re: Can't ZAP File - In Use

                    Originally posted by SNusa View Post
                    To close all open tables for any .dbf application, this should work when run from the IW, but it doesn't!


                    Code:
                    dim vc_OpenTableList as C
                    debug(1)
                    'ON ERROR RESUME NEXT    'some tables are presumably internal, and can't be closed...  This gets around the problem.
                    vc_OpenTableList = TABLE.enum_open()    'get list of tables
                    msgbox("vc_OpenTableList")    'show OPEN tables...
                    for each item in vc_OpenTableList    'loop through tables
                         TABLE.GET(item.value).close()    'use table pointer (without assigning a variable to the pointer) to close table.
                              ' (these two lines below are the same as one line above)
                              ' dim vp_Table as P = TABLE.GET(item.value)    'this line gets pointer to table.
                              ' vp_Table.close()    'close OPEN table ~ PROBLEM HERE.....
                    next
                    'now zap that table!
                    Where did this code come from?
                    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


                      #11
                      Re: Can't ZAP File - In Use

                      Robert,

                      Did you try the example in the docs? Sometimes they aren't fully laid out.

                      Only the interactive window open.

                      Code:
                      ? table.enum_open("F"+crlf())
                      = C:\PROGRAM FILES\A5V11\TEMP\A_CASE.DBF
                      C:\PROGRAM FILES\A5V11\TEMP\A_GLOSS.DBF
                      <NUL>
                      <NUL>
                      
                      'switch to control panel, open browse of customer table, switch back to interactive
                      ? table.enum_open("F"+crlf())
                      = C:\PROGRAM FILES\A5V11\TEMP\A_CASE.DBF
                      C:\PROGRAM FILES\A5V11\TEMP\A_GLOSS.DBF
                      <NUL>
                      <NUL>
                      c:\program files\a5v11\samples\alphasports\customer.dbf
                      
                      
                      dim tbl as P
                      tbl = table.get("C:\DATABASES\ALPHASPORTS\CUSTOMER.DBF")
                      ERROR: No such table
                      'I believe the error occurs because the customer table is open in another session.
                      There can be only one.

                      Comment


                        #12
                        Re: Can't ZAP File - In Use

                        Originally posted by Stan Mathews View Post
                        Robert,
                        Did you try the example in the docs? Sometimes they aren't fully laid out...
                        'I believe the error occurs because the customer table is open in another session.
                        Hi Stan;

                        I've tried all sorts of things (including the examples) with this. What doesn't make sense it that the following enumeration code (for forms) works just fine across all open forms, when getting names of forms. ~One would expect that the .close() method to work in a similar fashion across all open tables. But I'm guessing you may be right.

                        Code:
                        dim vp_Form as P = parentform.this
                        dim vp_Object as P
                        dim lst as C
                        
                        lst = A5.Form_Enum(2)
                        ui_msg_box("FORMS:",lst)
                        for each thingy in lst 
                        if is_object(thingy.value)	
                            vp_Object = obj(thingy.value) ' -WORKS
                            if(thingy <> parentform.Name(),vp_Object.close(),"")    ' closes all open forms except this one...
                        end if
                        Next
                        PS: I'm aware that the if/then loop (above) is a strange hybrid of if and iif, but it works OK, so I left it in place....
                        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


                          #13
                          Re: Can't ZAP File - In Use

                          One would expect that the .close() method to work in a similar fashion across all open tables.
                          Closing a form is quite a different matter from closing a table. What should happen if one executed a command to close a table and there was a form open based on that table and the form had an incomplete record entry/edit in progress?
                          There can be only one.

                          Comment


                            #14
                            Re: Can't ZAP File - In Use

                            Originally posted by Stan Mathews View Post
                            Closing a form is quite a different matter from closing a table. What should happen if one executed a command to close a table and there was a form open based on that table and the form had an incomplete record entry/edit in progress?
                            Thanks Stan. Perfect analogy.

                            ~Obviously, this difference (expected versus actual behavior) of the ".close()" method [on different object types] is necessary here.

                            Your statement brought up another interesting related question: Does Table.enum_open() [and most other similar methods] return all open tables, or only open tables for one particular user? (Important considerations when enumerating!)
                            Apparently, methods such as table.close() and the likes must only act upon the current form/session/user, right? ~Now I'm getting a bit overwhelmed thinking about method "session-reach" & scope. Is this info concisely listed anywhere? ~ I think I may need to start a new thread on the board.

                            It's a bit "daunting" realizing that different methods (or one single method) like .close() can effect different object collections (classes) at a different "scope" (for lack of a better word!) What is the correct term/wording for this "scope" concept used in this context?
                            Making reference to a recent quote here on this forum, I'm thinking that: "I may also be (exploring) the deep end of the pool!"
                            (time to pull out the scuba gear)
                            Last edited by SNusa; 05-03-2012, 11:17 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


                              #15
                              Re: Can't ZAP File - In Use

                              Originally posted by Al Buchholz View Post
                              Where did this code come from?
                              Hi Alan & Ira;

                              ~Al, the code came from "my brain." Every thing works except for the close part. (Although the tables appear in the enumerated list, the tables aren't "there to close" unless they are explicitly opened via Xbasic code via table.open() etc.)....

                              Both Stan and Ira added some insight... But the thing is: <form>.close() method will & does [attempt] close all forms in the enumerated list where as <table>.close() does not consider (or even see) these tables as "open" (valid table objects) unless the tables were explicitly opened via Xbasic code.

                              ~I don't see the big difference in how either of these objects should be acted upon by .close(). Especially after taking into consideration the fact that underlying tables [in forms] can also be in "edit mode" at the time the <form>.close() method is invoked, yet <form>.close() attempts to get the job done regardless of this fact. (Whereas the <table>.close fails, indicating the tables are not even there....)

                              Put another way:
                              <frm>.close() will attempt (at least) to close all open forms in the enumerated list as reported by form.enum().
                              <tbl>.close() only acknowledges tables that were opened via Xbasic code. ~Thus implying the list returned by Table.enum_open() is not correct!

                              My present thoughts are:
                              When a form or browse is open, the underlying table is open. (So the enumerated table report is correct.)
                              But I'm also thinking that for tables, there must be two "internal definitions" of open tables: Those opened within a form, and those opened directly via Xbasic. (And table.close() can only see/act upon the latter.)

                              Or maybe, because the form/browse has opened the table... It is impossible to access the table to close it. (Because you can not have an open form with a closed table! ~ Now this is starting to make sense to me.) ~If this is the case, a different error [indicating as such] would be much more appropriate.
                              I think I've got it figured out: Closing a form also closes an underlying table. (But you can't close the table that a form is based on, without closing the form itself.) ~ On this premise, there is no bug, but the [no table found] error returned is a bit misleading, and "subject to misinterpretation."
                              Last edited by SNusa; 05-04-2012, 12:54 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

                              Working...
                              X