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

Using Session Variables to Pull Specific Data

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

    Using Session Variables to Pull Specific Data

    I have been all over the forum and help and I must be missing it.

    I have created a session variable (session.User_Name) which is actually a user's email address.

    How do I get it so certain pages (grids) pull only information pertaining to that User.

    I can log in and go to those pages but I see all users not just the one logged in.

    Any assistance would be wonderful.

    #2
    You place the filter in the A5W page. It would look like this:

    Code:
    tmpl_tr_mygrid = a5w_load_component("tr_mygrid")
    with tmpl_tr_mygrid
    	componentName = "tr_mygrid"
    	DBF.filter = "user_name = \""+session.User_Name + chr(34) 
    end with
    or

    Code:
    tmpl_tr_mygrid = a5w_load_component("tr_mygrid")
    with tmpl_tr_mygrid
    	componentName = "tr_mygrid"
    	DBF.filter = "user_name = " + quote(session.User_Name)
    end with
    Assuming user_name was your table's field for the email address and mygrid was your grid component.

    Just create the A5W page and insert the grid component, you will find a section like below where you can insert your filter.

    Code:
    tmpl_tr_mygrid = a5w_load_component("tr_mygrid")
    with tmpl_tr_mygrid
    	componentName = "tr_mygrid"
    end with
    Steve Wood
    See my profile on IADN

    Comment


      #3
      thanks again

      I did see that in my research and I didn't realize I could just type that line in. Worked fine.

      thanks as always.

      ken

      Comment


        #4
        I'm not totally out of the water I guess

        After it was working earlier I now get an Invalid Username or Password when I attempt to log on (from all log on points) which means there should be an error in my Validate Code but it looks right. I am using a correct username and password.

        if (session.User_Name = "") .or. (Password = "") then

        currentform.has_error = .t.

        currentform.error_message = "User name or password is blank."

        else

        dim correct_password as C

        correct_password = lookup("[PathAlias.ADB_Path]\members", "Email="+quote(session.User_Name), "password")

        if (correct_password <> password) then

        currentform.has_error = .t.

        currentform.error_message = "Invalid user name or password."

        end if

        end if


        Is there something missing or wrong?

        Comment


          #5
          Your session is timing out

          include the
          <%a5
          a5w_include("logintest.a5w")
          %>

          in your new a5w file.
          Insanity: doing the same thing over and over again and expecting different results.
          Albert Einstein, (attributed)
          US (German-born) physicist (1879 - 1955)

          Comment


            #6
            Ken,

            I think Peter was responding to your earlier post about building your A5W page and including the logintest there. It will not affect the problem you are having in your login dialog (Invalid User name...). Can't guarantee this is it, but throw an alltrim() around your password variables, as in:

            if (alltrim(correct_password) <> alltrim(password))
            Steve Wood
            See my profile on IADN

            Comment


              #7
              Still getting error

              Tried the Alltrim but still get the error message. I don't see how it could work then not. I tried changing the session.User_Name back to just User_Name but the system points to that as an error.

              I also tried multiple username/passwords and they all failed.

              Any suggestions?

              Comment


                #8
                You're going to have to figure out if you are getting a value in your lookup (and other variables). Test the same in an A5W page like this:

                session.user_name = "myemail"
                ? lookup("[PathAlias.ADB_Path]\members", "Email="+quote(session.User_Name), "password")

                plublished and preceeded by a question mark so you can see the results of the lookup (should be your email address).
                Steve Wood
                See my profile on IADN

                Comment


                  #9
                  Where to Place

                  Do I put that in the Validate Code for the login in lieu of my current lookup or is it code by itself? I did the first and got the same Invalid error.

                  Comment


                    #10
                    All I'm saying is find some way to determine what you are getting back from your lookup, and to a lesser extent, the rest of your variables. It is pretty likely your variable Password contains what you expect since it comes directly from the dialog. but the lookup is suspect because, well you don't know for sure what it is returning. Bottom line is that your correct_password and password don't match, so the lookup is suspect.

                    A way to determine what the lookup returns is to run an A5W page. You would put in exactly what I posted:

                    session.user_name = "myemail"
                    ? lookup("[PathAlias.ADB_Path]\members", "Email="+quote(session.User_Name), "password")

                    ..where myemail is a known valid email address in your members database.
                    Steve Wood
                    See my profile on IADN

                    Comment


                      #11
                      Results

                      I created a a5w page that had only that code. Published it and then went to open it. I got a blank page- does that mean it is finding no password when the lookup runs?

                      Comment


                        #12
                        Yes, either the email is not found, or it does not have a value in the password field. Now, I know you probably have proper values in all fields. But it gets you closer, even if more perplexed! BTW, try going to the table and run Utilties / Pack to reindex and clean up the table, if that is a problem. To test the path, try temporarily renaming your members table, and run the A5 page. If there is NO error, then your alias is pointing to some other copy of your tables.

                        etc.
                        Steve Wood
                        See my profile on IADN

                        Comment


                          #13
                          List the entire *.a5w file so I can have a look.

                          Steve my point about the

                          <%a5
                          a5w_include("logintest.a5w")
                          %>

                          Was that if the session times out, the DBF.filter = "user_name = \""+session.User_Name + chr(34) will fail. So he needs to keep checking for it.

                          Also paste the actual error - it will help. Just to make certain of the problem.
                          Insanity: doing the same thing over and over again and expecting different results.
                          Albert Einstein, (attributed)
                          US (German-born) physicist (1879 - 1955)

                          Comment


                            #14
                            Still Occurring, Here's what I tried...

                            Looked at case sensitivity- didn't matter. Then I downloaded the data from the web to match up with my local dbase and they match perfectly (but I noticed the field names on some fields were shortened- not the "password" field though- cause to worry or is that standard?).

                            I entered on the web a new member from the web and was able to login fine. Went to try old member login- got the "Invalid User Name or Password". Is there something that could happen if I upload new data. It seems it works ok if I add in members from the web but once I download and then re-publish it all goes kablooky.

                            Comment


                              #15
                              I Think I know the problem- help to fix

                              My login issue is definitely due to uploading a table with data. When I upload my members.dbf the login doesn't work. When I manually enter in the same exact member info the login works, but it brings me to another issue. It appears that my members.dbf field rules don't upload as well. (BTW I am using Alpha 5's publishing).

                              Any of this make sense?

                              Comment

                              Working...
                              X