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

Restricting Multiple Sessions of A5

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

    Restricting Multiple Sessions of A5

    I was wondering if there is a simple way to restrict a user to have only one session of A5 of a particular application open at one time. I have searched for this subject but have found nothing.

    Any ideas would be appreciated.

    Dale

    #2
    RE: Restricting Multiple Sessions of A5

    Your autoexec script could try to obtain exclusive use of a table that gets opened when your startup form is opened. Failure to obtain exclusive use would cause the sctipt to abort and close the instance of Alpha.

    This would require

    an autoexec script
    a startup form that was always open
    a table that could remain in use while the app was in use (could be a dummy table with no other purpose)
    There can be only one.

    Comment


      #3
      RE: Restricting Multiple Sessions of A5

      Stan,

      That's not quite what I'm looking for. It's okay for several users to be accessing the application from their own PC's. What I want to restrict is any one PC or User from having more then one session of A5 open on their Windows desktop with the same application running.

      Dale

      Comment


        #4
        RE: Restricting Multiple Sessions of A5

        It is not clear if you want to keep a user from accidentally opening two sessions or want to absolutely prohibit it.

        You could use a routine in the autoexec to

        open a table
        check a flag field to see if the app is in use
        ask the user if they really want two sessions open
        abort if they don't
        write an in use flag to the field if it was not in use.

        You would have to control the exit process to make sure the flag was removed when the app was exited.

        If you don't use the ask the user portion above, they couldn't get back in if they had a system crash and the flag was not erased.
        There can be only one.

        Comment


          #5
          RE: Restricting Multiple Sessions of A5

          Stan,

          That sounds like a winner. I was thinking along those lines but came up with the crash senerio. I think asking the user should take care of that issue.

          Thanks for your suggestions.

          Dale

          Comment


            #6
            RE: Restricting Multiple Sessions of A5

            Dale,

            Ray Lions posted this script awhile back to prevent a user from opening two copies of the same app. It uses a text file to keep track. If there was a crash, it will let the user back in after answering the dialog. It goes in the autoexec script and you need a 'menu' or default welcome form that opens when you start the app to keep things from crashing as explained below. This may be what your looking for.

            Code:
            Msg ID:	34931
            Subject:	RE: prevent 2nd copy from opening
            Author:	Raymond Lyons
            Date:	06-27-2003 5:10 PM
            File:	
            As I said above, I have 2 running right now on A5v5 full. 
            
            Your concern about a crash can be handled with my text file suggestion as long as your app has a master menu that it starts from and all other forms eventually come back to it. Example code follows. 
            
            Ray Lyons 
            
            'Date Created: 27-Jun-2003 12:50:50 PM 
            'Last Updated: 27-Jun-2003 02:00:56 PM 
            'Created By : Ray Lyons 
            'Updated By : Ray Lyons 
            dim filename as c 
            filename = "C:\A5chk.txt" 
            result = file.exists(filename) 
            if result = .F. then 
            file.create(filename, FILE_RW_EXCLUSIVE) 
            goto continue 
            else 
            result2 = ui_msg_box("Application Load Halted","This application is either already running (check to see if it is minimized on your task bar) or you have you experienced a shut down from a crash. Have you experienced a crash?",UI_QUESTION_SYMBOL+UI_SECOND_BUTTON_DEFAULT+UI_YES_NO) 
            If result2 = UI_NO_SELECTED 
            A5.Close() 
            end 
            else 
            goto continue 
            end if 
            end if 
            continue: 
            'Put res of autoexec here or just end here or put an END up where continue is. 
            end 
            'Now, for this to work you ned a master menu form that all other forms 
            'comes back to when they are closed. 
            'Then in the CanExit event for the master menu put: 
            'Cancel() 
            'The master menu form will then need a Close button with: 
            
            'dim filename as c 
            'filename = "C:\A5chk.txt" 
            'file.remove(filename) 
            'A5.Close()

            Phil DeGruy

            Comment


              #7
              RE: Restricting Multiple Sessions of A5

              look in the code archive
              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: Restricting Multiple Sessions of A5

                I didn't think of looking there. I have added the code from the archive to my autoexec and all seems to work.

                Thanks to all that contributed to this post.

                Dale

                Comment


                  #9
                  RE: Restricting Multiple Sessions of A5

                  Martin,

                  I looked at what you posted in code archive. I am sure it works. However, I can't imagine how it could be preferable to my code that Phil posted above. Am I missing something or or in your scenarion is one supposed have Word (or any apps file for that matter) open whenever the app is running? Is so, I can't imagine how that is a desirable thing to do.

                  Ray

                  Comment


                    #10
                    RE: Restricting Multiple Sessions of A5

                    Ray,
                    I thing your looking at the wrong post in the archive. It's the post below the one that speaks of word.

                    Dale

                    Comment


                      #11
                      RE: Restricting Multiple Sessions of A5

                      Hello Dale,

                      Check out the sys_id_enum() function in the documentation. There is an example showing how to do exactly what you want, if I am understanding correctly.

                      Good luck,
                      Jim

                      Comment


                        #12
                        RE: Restricting Multiple Sessions of A5

                        Yes, Jim, I like that, but you have to decide what you want to close. If you leave in the sys_focus_put you will close the existing copy that was already open, but if you omit it, you close the copy that is trying to open.

                        Personally, its the 2nd one I want to close.
                        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


                          #13
                          RE: Restricting Multiple Sessions of A5

                          Martin,

                          Sorry for my comment above. I failed to take the time to grasp what your code was doing. Should have known better (you are not in the habit of posting things I "can't imagine" the reason for!).

                          Ray

                          Comment


                            #14
                            RE: Restricting Multiple Sessions of A5

                            hi Ray.

                            There is a minor problem with my script, and the one Jim was referring to - namely, that if you have some other something with the same name as your alpha window (like a word document) the script fires, and you cannot open the first copy ogf your app if the other document is already open, as the "window name" is what is being opened twice - thus I have to be sure that the name I use is unlikely to be used again.

                            If I could figure out how to distinguish whether the window is an "alpha" window or not, it would be perfect.
                            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


                              #15
                              RE: Restricting Multiple Sessions of A5

                              Yes, I can see that now, and it would be good if there is a way because with a large number of users the chance of someone naming an open doc with the same name goes up--though still not very likely. Anyway, the method I posted (as well as other ways using a flag in a table) does not have the same problem, is simple and quick. However, it does make use of something some might not like--users having to come back to a startup menu form in order to close A5. On the other hand, I find that "feature" to be a good one because otherwise users (including me) have a tendency to accidentally close A5 by clicking on the wrong X. But of course the latter "feature" can be implemented even under the code you posted. Maybe v6 will provide a better way.

                              Ray

                              Comment

                              Working...
                              X