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

Script running on startup form

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

    Script running on startup form

    I have A5V4.03 Build 230 running on a TCP/IP network. I also purchased the runtime version and patched in the 230 build for it. I have network optimized the first work station and my startup form has a ui_get_password script running OnActivate. The form opens fine and asks for the password on the server, but not on the workstation. The Opening form does not even have focus. Any suggestions would be greatly appreciated.

    #2
    RE: Script running on startup form

    Just as a reminder, did you refresh network after writing the script

    Comment


      #3
      RE: Script running on startup form

      Thanks for your response. I did refresh the network. I tried to move my password script around from OnActivate to OnInit now I get the password box, log on with the password, and the statup form just sits there maximized. Of course for security reason I have NOMINMAX setup on the shortcut. What is strange though I can startup the runtime version on the work station and then load the application and it works the way it is suppose to.

      Thanks for your time.

      Comment


        #4
        RE: Script running on startup form

        I haven't tried what you describe, but I do run a password routine from an autoexec script which seems to function well, either on the server or workstations. I have the routine closing A5 if the password fails three times, or loading a form from within the autoexec script.

        I have noticed some anomalies with scripts behaving differently on different events. Not sure if this is part of your problem but you might just give using autoexec a try.

        Tom

        Comment


          #5
          RE: Script running on startup form

          Tom thanks for your reply. What you are doing sounds like what I am trying to attempt. I moved my password script out of the autoexec script and attached it to a button on the startup form. I added a .push() statement in the OnActivate
          portion of the startup form. This seems to not be so unpredictable. Although the startup form doesn't work exactly the way I wanted it to, I quess it is better than nothing. If you have any ideals please let me know.
          Thanks again

          Comment


            #6
            RE: Script running on startup form

            Mark,
            I have a number of apps that have exactly the same problem you are having. My password script runs on the Onactivate event for the form that opens when the app starts. The problem I have is confined to the password message box not having focus when it loads. This has happened on all runtime builds I have tried as well as the full version. It only happens if the app is opened at the same time as the operating program by a shortcut, and not all the time. The type of computer, processor speed, video driver, etc seems to have no effect. Adding a pause before the password script runs had no effect. If the program starts first and then the app is opened, the password box always gets focus.

            I have found no solution after a number of posts some time ago. The users haved learned to just click on the password box and continue. I may try your solution and see if it works better.

            Jerry

            Comment


              #7
              RE: Script running on startup form

              Dear Mark,

              You might consider setting up your own password table. I find this useful in my apps. I use a field for the user name, password and also a permission value between 1 and 5. The latter can then be used in scripts to limit access to forms or actions (such as changing or deleting a record). I then design a small form with a box for the user name and one for the password (as well as a checkbox if the user wants to change their password). Use this form as the atartup form for your database. If the user name exists in the password table it looks up and compares the password. If the password is correct it looks up and assigns to a global variable the permission level. The form then closes and your main form opens. After three wrong tries, A5 closes. I find it more managable then the built-in password function.

              Comment


                #8
                RE: Script running on startup form

                John,
                Your ideal sounds real good. I would like to find some examples somewhere. Any suggestions

                Comment


                  #9
                  RE: Script running on startup form

                  Mark,
                  Funny you should ask, thats how I have set up all of my apps.

                  Attached is a zip file of an example of how you can set up a password file and access it on startup to set a global variable. There are 2 tables, "menu" and "access". I called my password table access.dbf. The table included has 1 dummy entry. I used an autoexec script to set up a global variable called code. On the OnActivate event for the startup form "MainMenu" I run the script Chk_Password. The value of this code is checked to hide or show buttons on the form. You could also use if to restrict access, load different forms, whatever. I also included some forms to add new users, edit their info, etc into the access.dbf table. If you open the forms and scripts in design mode, you will see that the table originally used some encryption functions to hide actual values for the passwords and access codes for each user. These are not included.

                  Hope this is useful.

                  Jerry

                  Comment


                    #10
                    RE: Script running on startup form

                    Jerry,
                    I greatly appreciate your help. This will make my life easier. I was woundering how I was going to tell my boss that I could not password protect the application that I spent 1 year working on.

                    Have a good day and thanks again
                    Mark Pierce

                    Comment


                      #11
                      RE: Script running on startup form

                      Dear Mark,

                      The way I set up my password scheme is to create a password table (i.e. "access_permission"). It has an "employee_id", "password" and "permission" field. I then create a form with a variable field "var->emp_id" and "var->pass_word". I have a checkbox in case the user wants to change their password. I have a "Cancel" button which closes A5 and an "OK" button which runs the script (I attatched a text file with the script I use). The form is assigned as the startup form for the database and I use an autoexec script to hide the controlpanel. The administrator assign each employee a permission level (1 the lowest). This permission level is saved as a global variable. I've also enclosed an example of a global function and related use for limiting user rights on changing a form (also in the attatched file). I also use a global variable that holds the employee ID. This is useful in filters (such as printing files assigned only to the employee who is logged on). Hope this is helpful.

                      Comment


                        #12
                        RE: Script running on startup form

                        John,
                        I appreciate your time. I am going to look at both examples and see how they run with my application.

                        Thanks again
                        Mark

                        Comment

                        Working...
                        X