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

Network Optimization

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

    Network Optimization

    I just ventured into a private home network and followed the instructions in the V12 Runtime + doc for network optimization. Two things; one, the line on page 28 that begins with create_shadow2 has three arguments. It only needs two. The second argument is inappropriate. Two, ever since trying to use this, every build I make using the same routine I have used for a decade returns access errors when trying to run the installed app. I tried installing my app on a single machine that ran it before this and it still fails. Did the optimization routine mess something up? If so, how can I correct whatever it messed up?

    My network is private and has a server, two PC's and a printer. I know I have permission issues as I can not print from more than one of the PC's.

    I know this is a loaded submit but any help would be appreciated. Thanks.

    #2
    What version of V12 are you using? Doc changed some time between 3670/4684 and 5887/5315. code for later versions below
    Code:
    dim master_db_name as C
    dim shadow_db_name as C
    master_db_name = ""
    shadow_db_name = ""
    ui_modeless_dlg_box("Install MyAppName",<<%dlg%
    {can_exit=exit}
    {lf};
    Specify the filename of the master copy of the application:;
    [%P=ui_get_file("Select file","(*.adb)",master_db_name)%.100master_db_name];
    {lf};
    <Click Here to Start Install!oK?.not.(master_db_name="")> <Cancel!cancel>;
    %dlg%,<<%code%
    if a_dlg_button = "cancel" then
    ui_modeless_dlg_close("Install MyAppName")
    a_dlg_button = ""
    end if
    if a_dlg_button = "oK" then
    if file.exists(master_db_name) = .f. then
    ui_msg_box("Error","Master Database not found.")
    else
    shadow_db_name = a5.Get_Name()
    a5.Load(master_db_name)
    create_shadow2(shadow_db_name,.t.)
    End If
    ui_modeless_dlg_close("Install MyAppName")
    end if
    %code%  )
    ​
    I suspect the doc change missed at some point then sorted on a later release.

    Past experience suggests easiest way to set up network optimisation is to open the master app on one PC, then select 'Tools->Network Optimize'. Complete the form as needed then 'Create Shadow Workspace'. Provided you use the same path for the master you can then copy the ewhole shadow folder to the other PCs.

    Comment


      #3
      My 'About' shows version 12.4.6.4.7, which is the latest stable build release. I will try your suggestion, thanks. One clarification though. When you state "on one PC" are you referring to the server?

      Comment


        #4
        Open the app on any PC and create the shadow including any extra files required. You can then just copy this folder to any other PC on the netwprk providied it accesses the share on the server using the same path.

        Comment


          #5
          That works great! How can I make it available in a runtime environment?

          Comment


            #6
            Just install runtime on each PC as needed and point it to the shadow copy.

            Comment


              #7
              I got some help with this a number of years ago. I modified this script to automate the whole process. This script is run by a hidden button in my application. After installing the runtime, I connect directly to the main application. I click on my hidden button and run this script. This script creates the shadow, makes a new shortcut, closes the application and then starts the new shadowed application. To use this for your application, one can go in and tweak the code where needed.

              Code:
              'Date Created: 20-Aug-2015 08:33:45 AM
              'Last Updated: 16-Feb-2023 10:45:01 AM
              'Created By  : verboopa2
              'Updated By  : Ron
              
              '------------
              'ShadowCreate
              '------------
              DIM DialogTtl as C = "Create Shadow Database (ShadowCreate)"
              
              '----------------
              '// do checks  --
              '----------------
              IF a5.Get_Master_Name()                            'verify this is not a shadow database
                  ui_msg_box(DialogTtl,\
                  *concat_lines("This is already a Shadow Database. A Shadow can not be built from a Shadow"),\
                  UI_ATTENTION_SYMBOL+UI_OK)
                  end
              end if
              '--------------------------------------
              
              
              '--------------------------------------
              '\\ explain option and get file name --
              '--------------------------------------
              DIM Shortcut_Name as C = "Work Orders & Invoices"        'default shortcut Title
              DIM Result as C                                    'Result of Dialog Box
              DIm Mess as C                                    'Check messages to user
              DIM ShadowName as C                                'Name of Shadow database to build
              DIM DefaultFolder as C                            'the shadow folder's name
              DIM RT_EXE as C                                    'returns the path of the Alpha Five runtime executable
              DIM ShortCut as C                                'determine all settings for creating a desktop shortcut
              DIM Description as C
              DIM StartIn as C
              DIM AppDataMaster as C
              DIM app_startup as C
              DIM Desktop as C
              DIM Icon as C                                    'Folder to build shadow database in
              DIM Target as C
              
              RT_EXE = a5.Get_Exe_Path() + "\\"
              DefaultFolder = RT_EXE + "Shadow" + chr(92) + file.filename_parse(a5.Get_Name(),"n")
              Target = RT_EXE + "alpha5.exe"
              
              Dialog = <<%dlg%
              {units=f}{font=calibri,11}{ysize=.3}{xmargin=2,2};;
              
              {region}
              {wrap=95}
              Build a Shadow \(Network Optimized\) Database.;;
              
              {region};
              Shortcut Name:  A new Shortcut will be created on the desktop for the Shadow Database.;
              [.40Shortcut_name];
              {endregion};;
              
              {region};
              Shortcut Icon:  It is recommended to use a custom icon stored on the server.  In the future, this missing custom Icon will indicate a loss of connectivity to the Server.;
              [%p=ui_get_file("Runtime Folder","Text (*.ico)",Icon,"");I=$a5_smart_file%.100Icon];
              {endregion};;
              
              {region};
              A5VxxRT.Exe Target:;
              [%p=ui_get_file("Runtime EXE File","Text (*.exe)",Target,"");I=$a5_smart_file%.65Target];
              {endregion};;
              
              {region};
              Specify an empty folder and create the shadow database.  I recommend the word Shadow be in the folder path.;;
              [%p=ui_get_path("Folder for Shadow Database",DefaultFolder,"");I=$a5_folder%.100DefaultFolder];
              {endregion};;;
              
              {region}
              {justify=center}
              <10,1.5&Proceed!Proceed?right(Icon,3)="ico">   <*10,1.5&Cancel!CANCEL>
              {endregion};
              %dlg%
              
              Code =<<%code%
                  if a_dlg_button = "proceed" then                             'Used to proceed after dialog            
                      Folder = DefaultFolder
                      Mess = ""                                                'but first do checks while dialog is on screen
                      IF Right(Folder,1) <> "\\"
                          Folder = Folder + "\\"
                      end if
                      ShadowName = file.filename_parse(Folder,"dp") + file.filename_parse(A5.GET_NAME(),"ne")
                      IF isnull(Folder)
                          Mess = *concat_lines(Mess,"A Folder Must be specified")
                      end if
                      IF file.filename_parse(Folder,"p") ="\\"
                          Mess = *concat_lines(Mess,"Shadow Database will not be created in Root directory")
                      end if
                      IF .NOT. isnull(Mess)                                    
                          ui_msg_box(DialogTtl,Mess,UI_ATTENTION_SYMBOL+UI_OK)
                          a_dlg_button = ""                                    'failed checks so we will no exit dialog
                      end if                                
                  end if
              %code%
              
              Result = ui_dlg_box(DialogTtl,Dialog,Code)                        'present Dialog
              if Result <>"Proceed" then                                        'do we proceed
                  end
              end if
              
              'debug(1)
              
              IF FILE.DIR_CREATE_RECURSE(DefaultFolder)
                  Folder = DefaultFolder
              else
                  ui_msg_box(DialogTtl,"Unable to create suggested default folder",UI_ATTENTION_SYMBOL+UI_OK)
                  end
              end if
              
              '------------------
              '// Now build it --
              '------------------
              AppDataMaster = :a5.Get_Path()
              ShortCut = win_special_folder("Desktop")+ "\\" + Shortcut_Name
              Description = "Launch the Program " + Shortcut_Name
              StartIn = file.filename_parse(ShadowName,"dp")
              app_startup = DefaultFolder + "app.startup"
              
              ''create the file app.startup and enter a line to hide the splash screen
              dim file_pointer as P
              file_pointer = file.create(StartIn + "App.Startup",FILE_RW_EXCLUSIVE)
              file_pointer.write_line("-NOSPLASH")
              file_pointer.flush()
              file_pointer.close()
              
              Arg = quote(ShadowName) + " -INCLUDE=" + quote(StartIn + "App.Startup")
              
              sResult = win_create_shortcut(ShortCut,Target,Description,StartIn,Icon,Arg)
              
              ''create the shadow, close the app and reopen using the shadow
              create_shadow2(ShadowName, .T., .T.)
              
              END  ​
              Alpha 5 Version 11
              AA Build 2999, Build 4269, Current Build
              DBF's and MySql
              Desktop, Web on the Desktop and WEB

              Ron Anusiewicz

              Comment


                #8
                Originally posted by Ronald Anusiewicz View Post
                I got some help with this a number of years ago. I modified this script to automate the whole process. This script is run by a hidden button in my application. After installing the runtime, I connect directly to the main application. I click on my hidden button and run this script. This script creates the shadow, makes a new shortcut, closes the application and then starts the new shadowed application. To use this for your application, one can go in and tweak the code where needed.

                Code:
                'Date Created: 20-Aug-2015 08:33:45 AM
                'Last Updated: 16-Feb-2023 10:45:01 AM
                'Created By : verboopa2
                'Updated By : Ron
                
                '------------
                'ShadowCreate
                '------------
                DIM DialogTtl as C = "Create Shadow Database (ShadowCreate)"
                
                '----------------
                '// do checks --
                '----------------
                IF a5.Get_Master_Name() 'verify this is not a shadow database
                ui_msg_box(DialogTtl,\
                *concat_lines("This is already a Shadow Database. A Shadow can not be built from a Shadow"),\
                UI_ATTENTION_SYMBOL+UI_OK)
                end
                end if
                '--------------------------------------
                
                
                '--------------------------------------
                '\\ explain option and get file name --
                '--------------------------------------
                DIM Shortcut_Name as C = "Work Orders & Invoices" 'default shortcut Title
                DIM Result as C 'Result of Dialog Box
                DIm Mess as C 'Check messages to user
                DIM ShadowName as C 'Name of Shadow database to build
                DIM DefaultFolder as C 'the shadow folder's name
                DIM RT_EXE as C 'returns the path of the Alpha Five runtime executable
                DIM ShortCut as C 'determine all settings for creating a desktop shortcut
                DIM Description as C
                DIM StartIn as C
                DIM AppDataMaster as C
                DIM app_startup as C
                DIM Desktop as C
                DIM Icon as C 'Folder to build shadow database in
                DIM Target as C
                
                RT_EXE = a5.Get_Exe_Path() + "\\"
                DefaultFolder = RT_EXE + "Shadow" + chr(92) + file.filename_parse(a5.Get_Name(),"n")
                Target = RT_EXE + "alpha5.exe"
                
                Dialog = <<%dlg%
                {units=f}{font=calibri,11}{ysize=.3}{xmargin=2,2};;
                
                {region}
                {wrap=95}
                Build a Shadow \(Network Optimized\) Database.;;
                
                {region};
                Shortcut Name: A new Shortcut will be created on the desktop for the Shadow Database.;
                [.40Shortcut_name];
                {endregion};;
                
                {region};
                Shortcut Icon: It is recommended to use a custom icon stored on the server. In the future, this missing custom Icon will indicate a loss of connectivity to the Server.;
                [%p=ui_get_file("Runtime Folder","Text (*.ico)",Icon,"");I=$a5_smart_file%.100Icon];
                {endregion};;
                
                {region};
                A5VxxRT.Exe Target:;
                [%p=ui_get_file("Runtime EXE File","Text (*.exe)",Target,"");I=$a5_smart_file%.65Target];
                {endregion};;
                
                {region};
                Specify an empty folder and create the shadow database. I recommend the word Shadow be in the folder path.;;
                [%p=ui_get_path("Folder for Shadow Database",DefaultFolder,"");I=$a5_folder%.100DefaultFolder];
                {endregion};;;
                
                {region}
                {justify=center}
                <10,1.5&Proceed!Proceed?right(Icon,3)="ico"> <*10,1.5&Cancel!CANCEL>
                {endregion};
                %dlg%
                
                Code =<<%code%
                if a_dlg_button = "proceed" then 'Used to proceed after dialog
                Folder = DefaultFolder
                Mess = "" 'but first do checks while dialog is on screen
                IF Right(Folder,1) <> "\\"
                Folder = Folder + "\\"
                end if
                ShadowName = file.filename_parse(Folder,"dp") + file.filename_parse(A5.GET_NAME(),"ne")
                IF isnull(Folder)
                Mess = *concat_lines(Mess,"A Folder Must be specified")
                end if
                IF file.filename_parse(Folder,"p") ="\\"
                Mess = *concat_lines(Mess,"Shadow Database will not be created in Root directory")
                end if
                IF .NOT. isnull(Mess)
                ui_msg_box(DialogTtl,Mess,UI_ATTENTION_SYMBOL+UI_OK)
                a_dlg_button = "" 'failed checks so we will no exit dialog
                end if
                end if
                %code%
                
                Result = ui_dlg_box(DialogTtl,Dialog,Code) 'present Dialog
                if Result <>"Proceed" then 'do we proceed
                end
                end if
                
                'debug(1)
                
                IF FILE.DIR_CREATE_RECURSE(DefaultFolder)
                Folder = DefaultFolder
                else
                ui_msg_box(DialogTtl,"Unable to create suggested default folder",UI_ATTENTION_SYMBOL+UI_OK)
                end
                end if
                
                '------------------
                '// Now build it --
                '------------------
                AppDataMaster = :a5.Get_Path()
                ShortCut = win_special_folder("Desktop")+ "\\" + Shortcut_Name
                Description = "Launch the Program " + Shortcut_Name
                StartIn = file.filename_parse(ShadowName,"dp")
                app_startup = DefaultFolder + "app.startup"
                
                ''create the file app.startup and enter a line to hide the splash screen
                dim file_pointer as P
                file_pointer = file.create(StartIn + "App.Startup",FILE_RW_EXCLUSIVE)
                file_pointer.write_line("-NOSPLASH")
                file_pointer.flush()
                file_pointer.close()
                
                Arg = quote(ShadowName) + " -INCLUDE=" + quote(StartIn + "App.Startup")
                
                sResult = win_create_shortcut(ShortCut,Target,Description,StartIn,Icon,Arg)
                
                ''create the shadow, close the app and reopen using the shadow
                create_shadow2(ShadowName, .T., .T.)
                
                END ​
                Thanks for sharing this Ron. I've always thought about adding something like this but didn't know where to start.

                After a few tweaks to match our system, it works great!

                Comment


                  #9
                  A wise man (Bill Parker, an Alpha sage) once told me he didn't use optimization. And that the only difference in performance is in the original load. After that there is no appreciable difference.
                  At the time I had a big Medical app that was giving me fits with optimization, but after the change I never had a problem.
                  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
                    Originally posted by martinwcole View Post
                    A wise man (Bill Parker, an Alpha sage) once told me he didn't use optimization. And that the only difference in performance is in the original load. After that there is no appreciable difference.
                    At the time I had a big Medical app that was giving me fits with optimization, but after the change I never had a problem.
                    I have been running an extensive desktop app via shadow for years. Outside of occasional unexplainable, random errors, it runs pretty well with about 8 users active at a time.

                    The above inspired me to try running all the desktops directly from the server and eliminate the shadow to see what happens. We have all brand new hardware, including the server. We also have a 1,000 Mbps network. I came in early and eliminated the shadow on each desktop without notifying any of my employees.

                    By noon, I had multiple complaints from several users asking why the system was running slow. They all experienced a slight delay whenever they attempted to open forms, enter data, etc. It caused the fast typers/clickers the most trouble as they were having issues having to click buttons multiple times as the first click hadn’t executed yet as it normally does. The lag was causing issues as they would already be several clicks in and the first click still hadn’t executed.

                    Needless to say, I shut the system down and recreated the shadow on all the desktops and everyone was happy again.

                    I suspect if our environment always ran without the shadow, nobody would know otherwise and all would fine.

                    Your mileage may vary, but that was my experience yesterday.

                    At least it was quite easy to recreate the shadows, since I just implemented Ron’s auto creation script into our app the day before.

                    Comment


                      #11
                      The best performance and least number of issues in the desktop environment in my never to be humble opinion is each user having a remote desktop connection to a server where everything runs on the server and the user has a window on their desktop to the server.

                      Shadow not needed, data access and processing is much faster, less network issues and traffic, and a server is more stable.

                      Also called a thin client.
                      Al Buchholz
                      Bookwood Systems, LTD
                      Weekly QReportBuilder Webinars Thursday 1 pm CST

                      Occam's Razor - KISS
                      Normalize till it hurts - De-normalize till it works.
                      Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                      When we triage a problem it is much easier to read sample systems than to read a mind.
                      "Make it as simple as possible, but not simpler."
                      Albert Einstein

                      http://www.iadn.com/images/media/iadn_member.png

                      Comment


                        #12
                        I got in trouble at a site when I refered to a "Thick Client" - true.
                        See our Hybrid Option here;
                        https://hybridapps.example-software.com/


                        Apologies to anyone I haven't managed to upset yet.
                        You are held in a queue and I will get to you soon.

                        Comment

                        Working...
                        X