none
VFP EXE RUN SLOW IN LOCAL NETWORK. RRS feed

  • Question

  • Dear ALL

    Please Help me to solve this 

    my Exe is run very slow in local network  i have one server and my exe is in this server and i share this server in local network.

    i add sort cut of exe in all computer in local server there is more then 70 user have use same so what improvement is necessary

    to speedup my exe because some report are open very slow for reference my main program below.

    ************************

    main3.prg

    CLOSE ALL 
    CLEAR ALL 
    _screen.Themes = .F.   
    SET TALK OFF
    SET STAT OFF
    SET DATE BRIT
    SET CENT ON
    SET SAFETY  OFF
    SET BELL OFF
    SET DELETED On
    SET EXCLUSIVE OFF  
    SET MULTILOCKS ON
    set stat bar off
    SET date SHORT 
    ****************
    **********************************
    SET REFRESH TO 0,0 
    SET TABLEVALIDATE TO 2
    SYS(3054) 
    *SET PROCEDURE TO SetMemory.PRG ADDITIVE 
    *=SetMemory()



    PUBLIC glLoginSuccess

    DO FORM loginmaster.scx  
    READ EVENTS

    IF glLoginSuccess
    DO menu
    ENDIF 
    RETURN 

    *************************************

        


    Thursday, August 30, 2018 4:42 AM

Answers

  • Regarding your settings. Watch out some are per datasession. See help topic "Commands that Scope to a Data Session"

    Recommended Tablevalidate settings vary, but from a thread in tek-tips can be concluded bit #2, value 2^2=4 is the most important one to set, that means tablevalidate setting of 6 instead of 2. see https://www.tek-tips.com/viewthread.cfm?qid=1770305

    SYS(3054) does nothing, but turn off display of rushmore optimization "plans". You commented memory settings - meaning SYS(3050) settings, those are important to do, don't let this be done automatically.

    Also, after you switch to run locally, if queries are slow, ensure you have the indexes rushmore can make use of and SET OPTIMIZE ON, of course.

    Bye, Olaf.

    Thursday, August 30, 2018 9:22 AM

All replies

  • Look around and you'll see poeple always have this problem when running an EXE located in a share by a shortcut. You also have the problem of not being able to update the EXE while any user runs it.

    The solution is a start script copying it to a local drive and running it there, every user gets his own EXE.

    I recommend a robocopy in mirror mode.

    Bye, Olaf.


    • Edited by OlafDoschke Thursday, August 30, 2018 9:05 AM
    Thursday, August 30, 2018 5:13 AM
  • Regarding your settings. Watch out some are per datasession. See help topic "Commands that Scope to a Data Session"

    Recommended Tablevalidate settings vary, but from a thread in tek-tips can be concluded bit #2, value 2^2=4 is the most important one to set, that means tablevalidate setting of 6 instead of 2. see https://www.tek-tips.com/viewthread.cfm?qid=1770305

    SYS(3054) does nothing, but turn off display of rushmore optimization "plans". You commented memory settings - meaning SYS(3050) settings, those are important to do, don't let this be done automatically.

    Also, after you switch to run locally, if queries are slow, ensure you have the indexes rushmore can make use of and SET OPTIMIZE ON, of course.

    Bye, Olaf.

    Thursday, August 30, 2018 9:22 AM
  • dear sir 

    can you help me on start script copying how to do this because i have no idea fro this 

    Friday, August 31, 2018 5:46 AM
  • Robocop is one line of code. And as I said look around, there are tons of start script examples in such discussions.

    robocopy /MIR \\share\myapp\ c:\myapp
    start /b c:\myapp\myapp.exe 

    Saved as startmyapp.cmd and started with a shortcut to it.

    Bye, Olaf.

    Friday, August 31, 2018 6:26 AM
  • dear sir 

    can you help me how to crate exe installer of my exe and how to install in other user and 

    hows user can access free table database   that have in my server 

    Friday, August 31, 2018 7:34 AM
  • You don't need an installer and your EXE can stay as is. All the users need is the shortcut to the CMD instead of the EXE. And the CMD file can be on the share, too.

    Of course ideally an EXEcutable installed local is installed into the system directory of program files, but if you accepted an installation in a share you can also accept an "installation" into c:\myapp instead of the system directory.

    This is meant to work with the same privileges and access users have, they now even need less access in the share, they only need to be able to read there, not create or execute. The only share they still need to be able to write into is the data share.

    Once an exe runs, it can access data anywhere, that's only depending on what you program, the data can and will need to stay on a share. It siply needs to be there to be, well, shared. Nothing changes that and introducting the cmd script doesn't change that at all.

    If the EXE is not from you and is expects data local in its own directory, it's typically not able to work with shared access anyway, it's not prepared for concurent data changes. The best you can try is set the working directory of the shortcut to the cmd to the share, so the EXE is copied and runs local, but the default directory still is the share with the data. And that should be separate from the share of the EXE you copy, or users make an unnecessary copy of all current data when they start the EXE.

    Bye, Olaf.


    • Edited by OlafDoschke Friday, August 31, 2018 3:25 PM
    Friday, August 31, 2018 9:21 AM
  • Dear Sir 

    i don't understand how to do this 

    can you help in step by step 

    here is my server 192.168.40.20 and there is one folder in d directory that name is finance and i share this folder in so local user can access the data 

    i try you code in my share folder but when i create shortcut in user computer from server they show error . some DBF Not Found 

    Saturday, September 1, 2018 4:51 AM
  • open up notepad.

    copy the two lines I gave above, modify to your liking, regarding names and paths 

    Save this into the shared folder as yourapp.cmd

    Give users a shortcut to yourapp.cmd instrad of yourapp.exe

    Done

    Bye, Olaf.

    Saturday, September 1, 2018 8:12 AM
  • robocopy /MIR \\192.168.40.20\finance\finance.exe\ d:\works\finance\finance.exe
    start /b d:\works\finance\finance.exe 

    sir please help this is right or not .??

    Tuesday, September 4, 2018 6:56 AM
  • You robocopy a directory, not just the EXE file. Trust me, you will have an INI or FPW or config.dbf or you will put the C++ and VFP runtimes in there sooner or later.

    robocopy /MIR \\192.168.40.20\finance d:\works\finance
    start /b d:\works\finance\finance.exe

    Bye, Olaf.

    Tuesday, September 4, 2018 2:20 PM
  • in your suggestion we start local exe file not server exe file 

    but my live free-table database is in 192.168.40.20\finance 

    so how to use this live free-table database 

     


    • Edited by lfumakiya Wednesday, September 5, 2018 4:12 AM
    Wednesday, September 5, 2018 4:11 AM
  • >in your suggestion we start local exe file not server exe file 

    Yes, that is the goal of ot all, to avoid running the EXE shared.

    Your EXE should know where its data is located and SET DEFAULT to that.

    Or, as I alreaddy said earlier, change the working directory of your shortcut to the share.

    Wednesday, September 5, 2018 6:38 AM
  • How To do this 

    and also you say Change the working directory of your shortcut to the share

    how to do this 

    • Edited by lfumakiya Thursday, September 6, 2018 8:46 AM
    Thursday, September 6, 2018 8:45 AM
  • How to change working directory of a shortcut?

    Well, the shortcutr properties have the target, that's the finance.cmd file and it has a "Run in" where you can change the path. You can try whether that already makes your EXE start in that directory as current default directory differing from the local directory.

    How to do SET DEFAULT in code?

    Well, SET DEFAULT is a command. SET DEFALUT TO path. Look it up in the VFP help.

    FYI, Just notice often in this forum people write in caps not to shout, but to denote VFP code. So actually I already told you the command to write into your own EXEcutable main.prg: SET DEFAULT, you can also use CD (short fo change directory).

    Bye, Olaf.

    Thursday, September 6, 2018 10:38 AM
  • dear sir 

    i have changes this type of code in my main program but the did not work 

     

    IF _vfp.StartMode = 4 

    CD \\192.168.40.20\orion\Finance
    SET DEFAULT TO \\192.168.40.20\orion\Finance

    ENDIF 


    CLOSE ALL 
    CLEAR ALL 
    _screen.Themes = .F.   
    SET TALK OFF
    SET STAT OFF
    SET DATE BRIT
    SET CENT ON
    SET SAFETY  OFF
    SET BELL OFF
    SET DELETED On
    SET EXCLUSIVE OFF  
    SET MULTILOCKS ON
    set stat bar off
    SET date SHORT
    SET OPTIMIZE ON 
    ****************
    **********************************
    SET REFRESH TO 0
    SET TABLEVALIDATE TO 14
    SYS(3054) 
    SYS(3051)
    SYS(3050,1)
    *SET PROCEDURE TO SetMemory.PRG ADDITIVE 
    *=SetMemory()


    PUBLIC glLoginSuccess

    DO FORM loginmaster.scx  
    READ EVENTS

    IF glLoginSuccess
    DO menu
    ENDIF 
    RETURN 



       
    Friday, September 7, 2018 6:47 AM
  • The code that follows READ EVENTS doesn't run until after CLEAR EVENTS. If you're trying to set up a menu to be available throughout your application, you have to run it before READ EVENTS.

    Tamar

    Friday, September 7, 2018 8:10 PM
    Moderator
  • Dear sir 

    robocopy is not work properly if i have changes and  update my exe then robocopy doesn't copy new exe file.  

    Tuesday, September 11, 2018 4:36 AM
  • please help 
    Wednesday, September 12, 2018 11:16 AM
  • Hello,

    robocopy works without problems on millions of pcs.

    It cannot copy the file if it is in use (Exe started or blocked by AV program) or missing rights on target dir.

    If its blocked because exe is started you can use the mechanism of a loader.

    On users pc lets have a local directory maybe c:\myapp. In this directory there is a loader.exe (to which the user has a shortcut) and your real app myexe01.exe . loader.exe or however you name it searches for latest version of the "real" program and starts it.

    If your real exe is named myexe01.exe  on an update you simply copy or robocopy myexe02.exe into the local directorys. Later on then myexe03.exe, myexe04.exe...

    On next start the loader finds the newer myexe02.exe and starts it.

    so it looks like :

    c:\myapp

      loader.exe

      myapp01.exe

      myapp02.exe

    You can find many examples for loaders, for example on foxite. Some even work with Updates via Internet. Basically loader.exe uses ADIR to gather the myexe* in the directory, selects the latest (Datetimestamp, name) and starts it via DO.

    If there is an error simply delete newest version so loader will load the one before.

    Even if users use your app you can copy the new version.

    Hth

    Tom



    • Edited by tom knauf Thursday, September 13, 2018 7:14 AM
    Thursday, September 13, 2018 6:47 AM
  • i have used this code but i show this type of error message what can i do 

    Monday, February 4, 2019 7:10 AM
  • Hello,

    if you are answering to my post from 5 month ago :

    As mentioned there pls use an own directory for handling.

    c:\windows is a protercted folder and depending on the OS many things do not work if files are placed there, same with c:\programs and other folders.

    Best regards

    tom

    Monday, February 4, 2019 8:09 AM
  • i have not placed any files in this mention folder when click myapp.cmd this type of message show  

    how can it do can you help me to short out this .

    Best Regards 

    Lakshay 

    • Edited by lfumakiya Tuesday, February 5, 2019 4:16 AM
    Tuesday, February 5, 2019 4:07 AM
  • Error messages about files not found report the current path, not necessarily the intended path by a command or in this case the cursorsource property of a cursor object of the form's data environment (DE).

    What you obvisously missed to do is establish better than system error handling to show you where in which part of a form or obkect or prg the error occurs. Here it would be nice to know which form causes that problem, you'll need to look into the form to see where the file is during development.

    One thing is clear: Something looked for a oriuic.dbf table file, very liklely an object in the DE of a form, there are cursor objects for tables, views and cursoradapters you put into a forms DE. May also be a report DE.

    'So you forgot to provide this DBF in some installation folder the DE should look into or make it part of a DBC you open at application start making a DE look into the current DBC and not only along SET PATH or current dir.

    A question is, why you wouild CD to C:\Windows, but likely the data environment cursor with Alias oriuic doesn't point there.

    Bye, Olaf.

    • Edited by OlafDoschke Tuesday, February 5, 2019 2:07 PM
    Tuesday, February 5, 2019 2:05 PM