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

Process cannot access the file

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

    Process cannot access the file

    I am a new user.

    Can anyone help me figure out how to print reports from a form that has a preceeding Query Event?

    I am getting a message:

    Script:OnPush line 63
    tbl.query_detach_all()
    The process cannot access the file because because it is being used by another process.
    C:\Document and Settings\Jim Ostrom\Local Settings\Temp\$$173200.MPX

    In the Control Panel I have 15 Query operations that select various records and 5 Reports that print the selected records.

    When I run a Query and a Report from the control panel, the correct records are selected and print OK.

    When I run the same process from a Form, the first Query works and Report is correct. The next Query is ignored and I get the same records selected when I view the report.

    So I put the XBasic code:

    dim tbl as P
    tbl = table.current()
    tbl.query_detach_all()

    in the Form's Button OnPush Layout after the "Preview a layout" event (with the "specify which records to preview" option) in order fix the problem and I get the above error message.

    I even set the "Private Path" in the "Directories" window of the "Systems Settings" to the same directory of my database files and still get the error message.

    Any suggestions on how to proceed?

    Thanks.

    #2
    Re: Process cannot access the file

    you are getting the error, most likely, because the form has an order and/or because it is based on a set -
    try
    parentform.show_all()
    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


      #3
      Re: Process cannot access the file

      Jim

      Your report should be set to use the current selection of records.

      Open your report in report design, report, select records, (radio buttons) - base report on currently selected records.

      Is that the setting that you have? Otherwise send a picture of your setting or post an example of your system.
      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: Process cannot access the file

        Martin:

        I added parentform.show_all() to my XBasic in my "Reports 4" Form - still getting "Process cannot access the file" message


        Al:

        I have "currently selected records" in all my Querys and Report Forms - still can't report on those records when I am using the Report Form.

        I am attaching a ZIP file of the database.

        You can duplicate the problem as follows:

        - Run the Query Operation "Job=ROF CompDate=Nov2006

        - Run the Report "Job Cost Yr Report

        - Run the Query Operation "CompDate=2006 Job=ROF"

        - Run the Report "Job Cost Yr Report again

        The first query selects records where the CompDate is 11/30/2006 and Job Type is ROF

        The second query selects records for the year 2006 and Job Type is ROF

        The Job Cost Yr Report prints the selected records and subtotals by month.

        Using this method, the reports are fine.

        The problem occurs when I try the same thing from the "Reports 3" Form

        The "Select/Sort/Report" Button is designed to allow you to choose from all available Query Operations to select the records, then immediately choose from all available Reports and View/Print the selected records.

        It may work with the first Query operation, but not with subsequent Query operations.

        It seems to loose the link to the currently selected records...

        I do not know why...


        Any recommendations are really appreciated.

        Thanks,

        Jim

        Comment


          #5
          Re: Process cannot access the file

          All the saved query ops are defined for the same table. I think what's happening is that the first action in your "Select/Sort/Report" button script is running each saved query operation against "currently selected records" at a time when the previous query remains in effect.

          Try changing the first action so that it runs each saved query operation without any additional selection criteria. See the attached image.

          Comment


            #6
            Re: Process cannot access the file

            Tom:

            I changed the first action so that it runs each saved query operation without any additional selection criteria.

            Now, no matter what query I choose, all the records showup in the report.

            Is there an XBasic command I can add that will keep the latest currently selected records available for a report in the form mode?

            Regards,

            Jim

            Comment


              #7
              Re: Process cannot access the file

              Originally posted by Abacus Associate View Post
              Tom:

              I changed the first action so that it runs each saved query operation without any additional selection criteria.

              Now, no matter what query I choose, all the records showup in the report.

              Is there an XBasic command I can add that will keep the latest currently selected records available for a report in the form mode?

              Regards,

              Jim
              Jim,
              I was finding this as well. The problem is (I think) that your report menu is based on the roof1 table. When you open that form in order to choose and run a report a particular set of records is already selected. From there even though you run your query operation it is that initial record set that gets used for the report because the report is being run from the context of the reports 3 form. You can test this by first running one of your operations from the control panel. Then open the reports 3 form. Now no matter which query you run the records chosen from the query run from the control panel will be what you get in the report. Copy your reports 3 form to the tomco menu table and you should see things behaving differently (right click the form and choose Copy To...)

              Edit:
              I also changed the second action so that it runs the report without any additional selection criteria.
              Last edited by Tim Kiebert; 07-17-2007, 01:35 AM.
              Tim Kiebert
              Eagle Creek Citrus
              A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

              Comment


                #8
                Re: Process cannot access the file

                Tim:

                Your solution is absolutely perfect.

                By the way, I changed both actions so that they use currently selected records - the process works fine. I felt it would be more logical and self-documenting...

                I originally created the Tomco Menu Table for the sole purpose of having the Start Menu Form automatically be the first form shown when Alpha 5 Ver 8 starts up.

                I think you have discovered that for Query's on a table/set to operate correctly, the form has to be associated with a different table/set.

                As I learn more techniques, I also should be able help others.


                Thanks again.

                ________________________________________
                Jim Ostrom

                "Creating Simple Solutions to Complex Problems"
                ________________________________________

                Comment


                  #9
                  Re: Process cannot access the file

                  Glad to be of help.

                  I am still not to sure about using the setting 'use currently selected records'. I don't think it does any harm in this case (as you say things are working) but I just think it isn't necessary. I would say that in this case when you say 'use currently selected records' that this is refering to the records selected in the form where the script is running from which now is based on the tomco menu table and therefore has no relevance to the procedure. You will find it mentioned more than once in this forum that Alpha 5 (apart from the odd hiccup) does exactly what you tell it to, not necessarily what you intended it to do. So if you don't want it to do anything then I would tell it to do nothing.
                  Tim Kiebert
                  Eagle Creek Citrus
                  A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                  Comment

                  Working...
                  X