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

a little query help?

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

    a little query help?

    hI AND tHANKS TO ALL!

    I have a query that just does not wish to run in runtime or with runtime.

    Code:
    t=table.open("comp.dbf",file_ro_shared)
    query.filter="lot=lotset"   'numeric field and variable  My AE stops here.
    query.order="Lot" 
    query.options="T" 
    ix=t.query_create() 
    group=t.group
    comptaxrate=t.taxrate
    compdtaxrate=t.dtaxrate
    docrate=t.docrate
    compname=t.name
    compaddress=t.address
    compcsz=t.cstzip
    addtrade=t.addtrade
    comppred=t.pred
    electron=t.electron
    t.close()
    Lot was a character field and had the following ="lot="+quote(trim(lotset)) with character field and it worked in v7. I have gone to v10.5 and it does not work. I could not come up with any way to get it to work, so I tried numeric. still says no field.

    Note** This only happens with runtime or if using either one on the runtime folder. When using developement on server, it works fine. ?????

    I can make it character or numeric if that should make a diff.
    Dave Mason
    [email protected]
    Skype is dave.mason46

    #2
    Re: a little query help?

    Still have to try this with a runtime, but try.

    query.filter="lot=VAR->lotset"

    Yes... working here in Version 10.5 runtime... as long as the variable is set.

    Here's the database I used to test. Set the variable to a value of 1 on startup.

    I was getting errors on the query create when the variable was not set.
    Last edited by Davidk; 07-23-2010, 06:10 PM.

    Comment


      #3
      Re: a little query help?

      Thanks dave - tried it. stil gives error - no field.

      currently using ( switched all back to character) Will try with runtime in the morning. Tired now.

      Code:
      t=table.open("comp.dbf",file_ro_shared)
      query.filter="lot="+quote(trim(lotset))
      query.order="" 
      query.options="T" 
      ix=t.query_create() 
      lot=t.lot
      group=t.group
      comptaxrate=t.taxrate
      compdtaxrate=t.dtaxrate
      docrate=t.docrate
      compname=t.name
      compaddress=t.address
      compcsz=t.cstzip
      addtrade=t.addtrade
      comppred=t.pred
      electron=t.electron
      t.close()  '.close()
      Dave Mason
      [email protected]
      Skype is dave.mason46

      Comment


        #4
        Re: a little query help?

        Dave,
        Try s_quote() instead as it was created mainly for variables which quote() was not....
        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


          #5
          Re: a little query help?

          Thanks David,

          That did not help

          I also tried S_quote to no avail.

          Dave
          Dave Mason
          [email protected]
          Skype is dave.mason46

          Comment


            #6
            Re: a little query help?

            Dave, you could use debug(1) to see where's falling over. (FWIW, I'm suspicious of the ro_shared parameter here, and would try your script without specifying any mode for the table being opened at all).

            A better solution in my book is to scrap the use of a query altogether. Open the source table, set the index, then fetch_find the desired record.

            -- tom

            Comment


              #7
              Re: a little query help?

              If both the table field "lot" and the variable "lotset" are character values, I would try this:
              dim shared lotset as c
              lotset="10" 'or whatever
              then your existing query using "lot=var->lotset"

              not sure if this will help, but I have found that I had to sometimes set variables as shared to get stuff to work
              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


                #8
                Re: a little query help?

                Thanks Martin,

                If both the table field "lot" and the variable "lotset" are character values, I would try this:
                dim shared lotset as c
                lotset="10" 'or whatever
                then your existing query using "lot=var->lotset"
                I have tried "lot=var->lotset"
                all are character and only 2 long.

                dim global lotset as c = 1 is what it is and gets is value from a dialog box after the 1 is set for the d box.
                Checked and it is correct.
                It does assign proper value.
                Thanks

                .
                Dave Mason
                [email protected]
                Skype is dave.mason46

                Comment


                  #9
                  Re: a little query help?

                  wouldn't "as c=1" need to be as c="1"
                  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


                    #10
                    Re: a little query help?

                    I have always used:

                    query.filter="lot= '"+lotset+"'"
                    Does that work?
                    Jay
                    Jay Talbott
                    Lexington, KY

                    Comment


                      #11
                      Re: a little query help?

                      I think you problem will be a field lentgh.

                      try

                      "lot=alltrim(var->lotset)"

                      or

                      "lot=" + alltrim(var->lotset)

                      or
                      "alltrim(lot) = alltrim(var->lotset)"

                      or
                      "var->lotset$lot"

                      etc
                      -----------------------------------------------
                      Regards
                      Mark Pearson
                      [email protected]
                      Youtube channel
                      Website

                      Comment


                        #12
                        Re: a little query help?

                        One other this when you debug what does the query.filter line actually show when you step past it?

                        It should show the value contained lotset variable if you have it correct
                        -----------------------------------------------
                        Regards
                        Mark Pearson
                        [email protected]
                        Youtube channel
                        Website

                        Comment


                          #13
                          Re: a little query help?

                          From first post:
                          Code:
                          t=table.open("comp.dbf",file_ro_shared)
                          query.filter="lot=lotset"   [COLOR="Red"]'numeric field [/COLOR]and variable  My AE stops here.
                          t=table.open("comp.dbf",file_ro_shared)
                          xo=t.order("","lot="+lotset)
                          lot=t.lot
                          group=t.group
                          comptaxrate=t.taxrate
                          compdtaxrate=t.dtaxrate
                          docrate=t.docrate
                          compname=t.name
                          compaddress=t.address
                          compcsz=t.cstzip
                          addtrade=t.addtrade
                          comppred=t.pred
                          electron=t.electron
                          t.close() '.close()
                          Last edited by Mike Wilson; 07-25-2010, 11:16 PM.
                          Mike W
                          __________________________
                          "I rebel in at least small things to express to the world that I have not completely surrendered"

                          Comment


                            #14
                            Re: a little query help?

                            Nothing offered has helped. This may be some kind of bug.
                            all are now back to character fields 2 long
                            Made a code change to be sure what is happening
                            *** Note*** A5V7 runtime opens it with NO PROBLEMS v9 does not.
                            Something I am missing here??

                            Code:
                            lot = lookupc("F",var->lotset,"lot","comp","Lot")
                            group = lookupc("F",var->lotset,"group","comp","Lot")
                            compname = lookupc("F",var->lotset,"name","comp","Lot")
                            compaddress = lookupc("F",var->lotset,"address","comp","Lot")
                            compcsz= lookupc("F",var->lotset,"cstzip","comp","Lot")
                            addtrade = lookupn("F",var->lotset,"addtrade","comp","Lot")
                            comppred = lookupn("F",var->lotset,"pred","comp","Lot")
                            electron = lookupn("F",var->lotset,"electron","comp","Lot")
                            docrate = lookupn("F",var->lotset,"docrate","comp","Lot")
                            comptaxrate = lookupn("F",var->lotset,"taxrate","comp","Lot")
                            compdtaxrate = lookupn("F",var->lotset,"dtaxrate","comp","Lot")
                            popup error:
                            There was an error running autoexec script
                            error: lookupc(F,var->lotset,lot,comp,Lot) No Such File


                            this works from the v10 - but not from shadowed tables. It does not matter if using runtime or developer. Runtime use on the main tables gives same error.

                            I am going to give the whole script so we can see if I may have an error somewhere else. AND YES the comp table is shadowed.

                            Code:
                            'Date Created: 01-Sep-2006 10:51:31 AM
                            'Last Updated: 29-Jan-2008 04:28:06 PM
                            'Created By  : dave
                            'Updated By  : dave
                            'dim t as P
                            't = table.open("names")
                            't.decrypt("heidi")
                            't.close()
                            default_encryption_key_set("heidi")
                            dim global versionnumber as n
                            versionnumber = A5_GetAppVersionNumber()
                            dim global cpath as c
                            dim global cmast as c
                            dim global regusers as n
                            dim global runtimeusers as n
                            dim global totalusers as n
                            statusbar.hide()
                            cpath = a5.Get_Path()
                            cmast = a5.GET_MASTER_PATh()
                            regusers = a5_registration_license_inuse(cmast+"\sales.muf")
                            runtimeusers = a5_registration_license_inuse(cmast+"\sales.rmuf")
                            totalusers = runtimeusers+regusers+1
                            'dim t as P
                            't = table.open("names")
                            't.encrypt("eaglet")
                            't.close()
                            dim global scode as c
                            dim global stat as c = "A"
                            dim global username as c = ""
                            dim global salesman as c = ""
                            dim global cellphone as c = ""
                            dim global usernow as c = ""
                            dim global password as c = ""
                            dim global reverse as c = ""
                            dim global worknumber as n = 0
                            dim global secused as c = ""
                            dim global group as c = ""
                            dim global lot as c = ""
                            dim global nowpath as c = ""
                            dim global compbat as n = 0
                            dim global comptire as n = 0
                            dim global comptaxrate as n = 0
                            dim global comppred as n = 0
                            dim global complemon as n = 0
                            dim global comptags as n = 0
                            dim global comppmtterm as n = 0
                            dim global comptermtype as n = 0
                            dim global compapr as n = 0
                            dim global compnewwheels as n = 0
                            dim global compantitheft as n = 0
                            dim global permissions as c = ""
                            dim global userlot as c = ""
                            dim global cpath as c = ""
                            dim global electron as n = 0
                            dim global compdtaxrate as n = 0
                            dim global docrate as n = 0
                            dim global compname as c = ""
                            dim global gotoileads as L = .f.
                            dim global gotosales as L = .f.
                            dim global gotoother as L = .f.
                            dim global gotoreports as L = .f.
                            dim global gotocsi as L = .f.
                            dim global buycar as L = .f.
                            dim global gotoslsschedule as L = .f.
                            dim global gotoslslabels as L = .f.
                            dim global setupemail as L = .f.
                            dim global seedealnumbers as L = .f.
                            dim global reshadow as L = .f.
                            dim global gotocomp as L = .f.
                            dim global cleantbls as L = .f.
                            dim global compaddress as c = ""
                            dim global compcsz as c = ""
                            dim global gotoinv as L = .f.
                            dim global editletters as L = .f.
                            dim global gotoslspeople as L = .f.
                            dim global editownpassword as L = .f.
                            dim global editownuserinfo as L = .f.
                            dim global seeallslspeople as L = .f.
                            dim global editpermiss as L = .f.
                            dim global surl as c = "http://"
                            dim global gotovendors as L = .f.
                            dim global gotoagents as L = .f.
                            dim global gotorebates as L = .f.
                            dim global deletesales as L = .f.
                            dim global makebackup as L = .f.
                            dim global advertisers as L = .f.
                            dim global editcompinfo as L = .f.
                            dim global gotobanks as L = .f.
                            dim global addtrade as n = 0
                            dim global ulot as c = ""
                            
                            dim global emok as L
                            emok = .f.
                            :a5.minimize()
                            '=========================
                            x = getstart()  'dialog to get user name and password into global vars.
                            '=========================
                            lot = lotset
                            t=table.open("employ",file_ro_shared) 
                            query.filter="username="+quote(trim(scode))
                            query.order="" 
                            query.options="T" 
                            ix=t.query_create() 
                             if ix.records_get()=0 then 
                              a5.close() 
                             end if
                            ulot=t.lot  
                            username=t.username 
                            salesman=t.salesname 
                            cellphone = t.cellphone 
                            password = t.password 
                            usernow = t.usernow
                            permissions = t.permissions
                            userlot = t.lot
                            gotoileads = t.gotoileads
                            gotosales = t.gotosales
                            gotoother = t.gotoother
                            gotoreports = t.gotoreports
                            gotocsi = t.gotocsi
                            buycar = t.buycar
                            gotoslsschedule = t.gotoslsschedule
                            gotoslslabels = t.gotoslslabels
                            setupemail = t.setupemail
                            seedealnumbers = t.seedealnumbers
                            reshadow = t.reshadow
                            gotocomp = t.gotocomp
                            cleantbls = t.cleantbls
                            gotoinv=t.gotoinv
                            editletters=t.Editletters
                            gotoslspeople = t.gotoslspeople
                            editownpassword = t.editownpassword
                            editownuserinfo=t.editownuserinfo
                            seeallslspeople=t.seeallslspeople
                            editpermiss=t.editpermiss
                            gotovendors=t.gotovendors
                            gotobanks=t.gotobanks
                            gotoagents=t.gotoagents
                            gotorebates=t.gotorebates
                            deletesales=t.deletesales
                            makebackup=t.makebackup
                            editcompinfo=t.editcompinfo
                            advertisers=t.advertisers
                            compbat = t.bat
                            comptire = t.tire
                            complemon = t.lemon
                            comptags = t.transfer
                            comppmtterm = t.term 
                            comptermtype = t.termtype
                            compapr = t.apr
                            compnewwheels = t.newwheels  
                            compantitheft = t.antitheft
                            t.close()
                            't=table.open("comp.dbf",file_ro_shared)
                            'query.filter="lot="+s_quote(trim(lotset))
                            'query.order="" 
                            'query.options="T" 
                            'ix=t.query_create() 
                            'lot=t.lot
                            'group=t.group
                            'comptaxrate=t.taxrate
                            'compdtaxrate=t.dtaxrate
                            'docrate=t.docrate
                            'compname=t.name
                            'compaddress=t.address
                            'compcsz=t.cstzip
                            'addtrade=t.addtrade
                            'comppred=t.pred
                            'electron=t.electron
                            't.close()
                            lot = lookupc("F",var->lotset,"lot","comp","Lot")
                            group = lookupc("F",var->lotset,"group","comp","Lot")
                            compname = lookupc("F",var->lotset,"name","comp","Lot")
                            compaddress = lookupc("F",var->lotset,"address","comp","Lot")
                            compcsz= lookupc("F",var->lotset,"cstzip","comp","Lot")
                            addtrade = lookupn("F",var->lotset,"addtrade","comp","Lot")
                            comppred = lookupn("F",var->lotset,"pred","comp","Lot")
                            electron = lookupn("F",var->lotset,"electron","comp","Lot")
                            docrate = lookupn("F",var->lotset,"docrate","comp","Lot")
                            comptaxrate = lookupn("F",var->lotset,"taxrate","comp","Lot")
                            compdtaxrate = lookupn("F",var->lotset,"dtaxrate","comp","Lot")
                             
                            
                            :a5.maximize()
                            If PrintDailyReport = "Y" then
                            dim global leasemonths as n
                            leasemonths = 10
                            script_play_local("printstartreports")
                            end if
                            delete leasemonths
                            if alltrim(pword)<>alltrim(password) then
                             UI_MSG_BOX("User","Your User name or Password is incorrect. UpsLog will now close",UI_OK)
                             sleep(3)
                             a5.close() 
                            end if
                            form.view("Begin")
                            Last edited by DaveM; 07-26-2010, 12:00 PM.
                            Dave Mason
                            [email protected]
                            Skype is dave.mason46

                            Comment


                              #15
                              Re: a little query help?

                              a little more help? When I create the shadow on the main tables, I lose the indexes to the table "comp".

                              Something is dead wrong.

                              copied a working table from v7 and it had 2 indexes, worked with dev a5v10, shadowed the tables and got an error of no index. Went back to the dev a5v10 and sure enough, the indexes were gone.

                              This is not good. Why would making a shadowed copy wipe out the indexes in both server and shadow???

                              also, in the shadow, a field in the table(default browse) cannot be changed nor can you add one.


                              .
                              Dave Mason
                              [email protected]
                              Skype is dave.mason46

                              Comment

                              Working...
                              X