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

Delete saved queries in Runtime

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

    Delete saved queries in Runtime

    Does anybody know if this can be done.

    Bob Whitaker
    Bob Whitaker


    #2
    RE: Delete saved queries in Runtime

    Perhaps I should expand on this. We have a client who recruits people to participate in focus groups. He has a table with some 12000 records which store data in a number of fields some logical, some character and some memo. When they are looking for people who match criteria set by the client they use "query by form" to build a query and select people who they may want to invite to take part. Very often during this recruitment process they may want to run this query again and again so they save it. Once the process is complete they then want to discard that query definition as otherwise the list of saved queries gets longer and longer. It would appear there is no way including the use of xbasic to do this. This seems odd to me as I feel if you provide a way for a user to save a query via runtime you should also provide the ability to remove them. Any thoughts would be helpful.

    Bob Whitaker
    Bob Whitaker

    Comment


      #3
      RE: Delete saved queries in Runtime

      Bob

      What you are looking for is "TBL".QUERY_DETACH_ALL(). From the help file

      "The "TBL".QUERY_DETACH_ALL() method detaches all temporary queries from a table"

      Jerry

      Comment


        #4
        RE: Delete saved queries in Runtime

        Thanks Jerry that just deactivates any queries - what I am looking to do is to delete SAVED queries.

        Presently this can only be done by right clicking in the control panel and deleting using the full version.

        Bob
        Bob Whitaker

        Comment


          #5
          RE: Delete saved queries in Runtime

          Bob,

          Try the Query.Delete() method. This method does bring up a verification dialog to assure that you want the query deleted. If you want it run silently without such dialog, I don't know how to accomplish such.

          Code:
          Query.Delete("YourQueryName")
          Steve

          Comment


            #6
            RE: Delete saved queries in Runtime

            Bob:
            I answered a closely related question in the past. I don't fault you for not being able to dig it up if you ran a search as it's more like a needle in a hay stack.

            Although I am not sure as to your reasoning for deleting a saved query (why was it saved in the first placed only to be deleted later ?? and if it was meant to be deleted later, why not create a query on the fly when needed? It's certainly a lot easier and SAFTER to create a script to run and re-run a query time and again rather than messing with the dictonary), nonetheless, here is the script:

            'open the data dictionary:
            t=table.open(c:\.........alpha\....ddd)
            'identify saved querries
            query.filter = "type='QBES'"
            qry=tbl.query_create()
            tbl.delete_range()
            tbl.close()


            Steve:
            querry.delet() is not a recognizable xbasic command. Add it to the wish list or use the above script to create a UDF.

            Once again, I do not see the logic of saving then deleting a saved query with xbasic, hence, I won't waste time creating a UDF that I won't use.

            Gabe
            P.S. I read your reasoning behind saving then deleting the query. I think you would be much better off changing your approach where you would use ONE saved query and a set of variable.

            Comment


              #7
              RE: Delete saved queries in Runtime

              querry.delet() is not a recognizable xbasic command.

              Gabe,

              Maybe "querry.delet()" is not recognizable but I successfully deleted some saved queries via xbasic using "query.delete()".

              Steve

              Comment


                #8
                RE: Delete saved queries in Runtime

                Big thank you all of you for your assistance. I think if you read my second post I outlined in detail why these queries were saved and reused over a number of days and were then discarded when the project was complete.

                Query.delete("????") does work and thank you for that.

                As a quick solution I have created a button that first of all brings up the "run saved query" dialogue so the user can see the names of the saved queries.

                Next comes a dialogue to fill a variable (qname) with the query name and finally some xbasic :-

                query.delete(var-"qname)

                This does precisely what I require and I am very appreciative of your help. I plan to experiment with xdialog to populate a dialoge box with the names of the variables so the variable can be filled from there to save the name having to be typed in again.

                Perhaps future versions might have a right click / delete facility in the run a saved query dialogue box.

                Bob Whitaker
                Bob Whitaker

                Comment


                  #9
                  RE: Delete saved queries in Runtime

                  Steve:
                  Here is what the help file says:

                  "The "OBJECT".DELETE() method applies to objects of type:
                  Browse
                  Form
                  Label
                  Letter
                  Report
                  The "OBJECT".DELETE() deletes the named object from disk"

                  As you see, query is not one of them. By the way, that was the first thing that came to mind. I tried to "cheat" the help file, but again, it didn't work for me. Don't know why !

                  Gabe

                  Comment


                    #10
                    RE: Delete saved queries in Runtime

                    Gabe,

                    I'm surprised it didn't work for you when you tried to "cheat".

                    I agree it is not in the documentation same as some other functions and methods which do work. For instance, I have made use of the function script_drop() which is not in the documentation at all. Maybe such functions are not intended for general use but they do work and they accomplish my goals.

                    BTW, while the documentation is as you stated, if you type "Query." in an xbasic script the "delete()" method will appear in the drop down list of available methods.

                    Steve

                    Comment


                      #11
                      RE: Delete saved queries in Runtime

                      Steve:
                      Believe me, I tried all of the above before trying to mess with the dictionary! Not a chance !!

                      Maybe you have the "Deluxe" version! I know, I should have bought the more expensive one !!

                      Gabe

                      Comment


                        #12
                        RE: Delete saved queries in Runtime

                        Gabe,

                        When you are editing a script and type in "query.", do you not see "delete()" in the drop-down list?

                        Steve

                        Comment


                          #13
                          RE: Delete saved queries in Runtime

                          No Sir I don't !!
                          There are only 4 options, delete is not one of them. Granted, I do not have the last built, but I doubt that's what it is!
                          Gabe

                          Comment

                          Working...
                          X