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

Having problem with query_create()

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

    #16
    Stan,

    I removed the OnKey event code too, however I still get the error:"ix=tbl.query_create()
    No such field"

    Comment


      #17
      Originally posted by lemow
      Stan,

      I removed the OnKey event code too, however I still get the error:"ix=tbl.query_create()
      No such field"
      I'm home now but I'll zip up and attach your sample tomorrow. It gave me no errors. Must be doing something differently.

      You did try with the same form I mentioned?
      There can be only one.

      Comment


        #18
        Ali, Alpha Five is receiving conflicting instructions from your design.

        Your button is trying to run a query against the table supporting the form. (The current table.) However, in the properties of the form layout you've RESTRICTED Query Commands, Select Index, Select Range, and Navigate. This means the form cannot be used to navigate through records in its table, nor can queries be run against it. Alpha Five cannot simultaneously block queries and navigation through form properties AND ALSO run your query against the table supporting the form from your button. Do you see the problem?

        Your query script will run fine if you:
        a) remove the restrictions mentioned above; and
        b) remove the tbl.drop() statement from your script. The drop() method is a method for index and query pointers, while "tbl" is a table pointer. No can do.

        If I may offer a few further suggestions:

        a) it's rarely a good idea to base a form that's used as a menu on a table that contains meaningful data. Here, I would create a dummy table, populate a single record, and base my menu forms on it, alone. Otherwise, you wind up with open data tables when other processes in your app may need exclusive access.

        b) Your button script runs a table wide query in order to find all records with a specific File_no. If each record in a given table is supposed to only and always have one record that matches any given File_no I would not run a table wide query to "find" it. It's quicker by far to simply create an index on the file_no field, then when you need to find a record make that index primary and then do a find by key (<tbl>.fetch_find()). Queries are useful when you need to find bunches or groups of records all of which meet the filter criteria. They're rarely the correct choice if you are really searching for a specific, single, record.

        -- tom
        Last edited by Tom Cone Jr; 05-10-2006, 08:03 PM.

        Comment


          #19
          Stan,

          That was the right form: MainFormFind.

          Tom,

          I changed the settings in the properties as you stated, but I keep getting the same error ("...tbl.query_create()... no such field")...
          This is one of those weird problems!

          Comment


            #20
            Ok, send us the table and its data dictionaries again. We need to see the ones you changed.

            What build of Alpha Five version 7 are you using?

            Comment


              #21
              Ok... here it is. basically did the changes that Stan asked earlier too... I also first removed the OnKey code event for the form but since it didn't have any effect, I put it back in.
              Last edited by lemow; 11-13-2006, 10:44 PM.

              Comment


                #22
                Ali,

                Your script runs fine once you finish making the changes I recommended to you. You "unchecked" the Query Command restriction, but your form still has check marks in the Restrictions for Select Index, Select Range and Navigate in form properties. In my previous post I recommended you remove these restrictions. Just remove the check marks and your script will work fine. When these entries are check you are telling Alpha Five to "Restrict" index changes, range changes, and navigation. "Restrict" means "Block" or "Prevent". Ok? The absence of a check mark means that these are NOT blocked, which is what you need in order to run your query.

                I'm using build 4035 / 3025 of Alpha Five vers7.

                -- tom

                Comment


                  #23
                  I still keep getting errors... I replaced "qfind=ix.records_get()" by "qfind=tbl.fetch_first" and did some more changes...
                  I did remove those restrictions Tom mentioned... The errors vary...
                  I am lost!

                  Comment


                    #24
                    Tom,

                    I am using Build 3005, 3880 of Alpha5 ver. 7.

                    Comment


                      #25
                      Ali, your version of Alpha Five is horribly out of date. Download the patches from Alpha Software. There's a "check for updates" button on your Help menu in Alpha Five.

                      In the meantime, here's a working example for you to tear apart. Unzip this to an empty folder. Do not mix with your development work. I've included additional sample data.

                      -- tom

                      Comment


                        #26
                        Tom,

                        I tried opening your sample in Alpha5 but there is no form... Cannot view the code for file Example... BTW. I updated the Build version to the latest. Thanks

                        Comment


                          #27
                          Ali,

                          My uploaded file contains a series of files. Unzip and extract them all to the same, empty, folder. Then start Alpha Five and open the Example database you'll find in that folder. It contains the Menu table and only one form, MainFormFind. If you still have trouble, I suggest you write down every step you took, so we can try to retrace your steps. If you're not able to create an empty folder, or to unzip and extract the files correctly I'm sorry I won't be able to help you.

                          -- tom

                          Comment


                            #28
                            Tom,

                            It's not difficult to unzip the files... It's what I see in Alpha5.
                            I unzipped your files into the empty folder, opened the Example database in Alpha5. The Menu table shows up in Control panel, under Tables/Sets. But when right clicking on it, none of the options are selectable!
                            Here is what I did and it worked, I selected Table tab, selected New Table and added it from the folder...
                            After viewing the code editor, and running it, the prompt asks for file # just like the main database I have. But once I put in the file #, it gives error:"tbl.query_create()
                            no such field"
                            With the other complete database, it gives the same error as well...

                            Comment


                              #29
                              It sounds to me like you're running the old copy.

                              Try this:

                              1) Open Alpha Five by itself. Do not double click on the Example ADB. Start Alpha Five from the Start menu.

                              2) Use the File / Open Database sequence from the menu to open the Example database you unzipped from me.

                              3) At that point examine the records in the Menu table by double clicking on it. If you don't see 3 records there, you've done something wrong. Stop, and go back to retrace your steps, all the way back to downloading my attachment, and then unzipping it again to an empty folder.

                              If you see three records, close the browse, choose the Forms tab of the control panel. You should see a single form. Double click it. Push the By File Number button. Read the dialog and make note of the file number you see. close the dialog, and then supply it when prompted to enter a file number. As you will see the script runs without error and the query is place in effect. You can verify this by closing the form, and then choosing the Tables / Sets tab of the control panel again. This time when you double click the table you will see only the selected record, because the filter from the query remains in effect.

                              This statement makes no sense to me:
                              After viewing the code editor, and running it, the prompt asks for file # just like the main database I have. But once I put in the file #, it gives error:"tbl.query_create() no such field"
                              Your script must be run from the button, it cannot be run from the Code page of the Control panel. I doubt it can be run directly from the code editor. I do not have a clue why you're doing it this way, but stop. Run it from the button, after opening the form. If you need to edit the script place the form in design mode, right click the button, choose Events, and then OnPush. Edit the script there. Then save it. Then save the form. Then run the script by pushing the button. Ok?

                              --- tom
                              Last edited by Tom Cone Jr; 05-11-2006, 10:08 PM.

                              Comment


                                #30
                                Tom,

                                I really appreciate your feedback and support.
                                I was able to view the code just like you mentioned and worked fine (Sample database).
                                In the main database, when I enter a file number, it's not recognizing the table... it gives me the message:"there is no matching file number"... when I modify the code, I get other errors like I pointed out earlier. I have to try to figure this out. Thank you again for your help.

                                Comment

                                Working...
                                X