Moving from VFP 5.0 to client/server

I currently have an application that was written in VFP 5.0 and running on Windows XP machines with the database stored on a Windows 2000 server. It was first installed in 2000 and has had modules added, the most recent being 6 months ago.

 However, I have been having some problems with the program seeing that the database sizes has grown considerably with at least 2 tables having over 20000 records.

 The hardware technician has indicated that their server needs to be replaced and said I should look into making my application a client/server one.  Right now, it is in a flat file format.  However I am totally new to this and have no idea how or where to start.

 Can anyone point me to some books that will assist me.  Also, will I have to completely change the code used to access my tables in reading and writing to them   I need to present a proposal for client/server software and changes to the company as soon as possible so I can have new version completed by March.

 

Thanks

 

 

 

 




Answer this question

Moving from VFP 5.0 to client/server

  • dewan2006

    I do not know why you are using a 'flat file' (I assume some kind of TXT, CSV, SDF like )

    VFP is perfectly capable of using relational databases (DBF) where 20,000 records is nothing. You can have millions of records and as long as one file does not reach the limit of 2GB (per file) you will have no problems.

    VFP can also do Client/Server (2-Tier) architexture or even more (N-Tier) but it will probably mean completely changing the architecture of your program. Depending on how it was written, it could be a very simple change to go Client./Server or it could mean a complete re-write.

    We do not have enough information from you but it sounds like a re-write.

    To use Client-Server with an external database like SQL Server or similar, you should read the chapter on it in Help.

    Also read about the following:

    Buffering

    SQL Pass-Through (SPT)  - SQLConnect() - SQLStringConnect() - SQLExec(), etc.

    CursorAdapter (not available in very old versions like VFP 5.0)

    Remote Views

    Also a book like "Client-Server Applications with Visual FoxPro and SQL Server 7" (http://www.hentzenwerke.com/catalog/csvfp.htm) even though written for VFP 7.0 will help.

     

    BTW, VFP 5.0 is a very old version,. You should consider upgrading to VFP 9.0. The difference in power and capabilities is tremendous!


  • Chunq

    I use VFP9. I tried to upsize my local database with approx 100000 records. I selected to create remote views. It went pretty good. I had the tables on SQL. The next step was to make the remote views updateable. Next I replaced all SEEK and SET ORDER TO commands with LOCATE. I imported the records from the local tables into SQL. After that the program were run, using SQL database.

    I know, it's not a good solution, because of heavy network load, unnecessary data moving between the server and the client. It was just a short test, what took only some hours.

    The next step is to use SQL Pass Through of course, to optimize the database access, searches and network load.



  • Fabián Imaz

    This is the code I have which starts my program:

     

    STORE SPACE(25) TO THEFILE
    SET TALK OFF
    SET CONFIRM ON
    SET SAFETY OFF
    SET CENTURY ON
    SET ESCAPE OFF
    SET EXACT ON
    SET ANSI ON
    APPLICATION.VISIBLE = .F.
    SET DATE MDY
    SET HELP TO C:\HELP.HLP
    CLOSE DATA ALL

    USE C:\DATA_PATH
    IF EMPTY(APP_PATH)
     MESSAGEBOX("NO DATABASE PATH FOUND"+NEWLINE+;
      "THE V.R.S SETUP WAS NOT COMPLETED"+NEWLINE+;
      "CONTACT YOUR SYSTEM ADMINISTRATOR",16,"V.R.S Critical System Error")
     QUIT
    ELSE
     STORE ALLTRIM(APP_PATH) TO SYS_PATH
    ENDIF

    STORE SYS_PATH +"\OPERATOR.DBF" TO THEFILE
    IF !FILE(THEFILE)
     MESSAGEBOX("INVALID DATABASE PATH"+NEWLINE+;
      "THE V.R.S SETUP WAS NOT COMPLETED"+NEWLINE+;
      "CONTACT YOUR SYSTEM ADMINISTRATOR",16,"V.R.S Critical System Error")
     QUIT
    ENDIF

    SET PATH TO &SYS_PATH

    OPEN DATABASE mydb SHARED
    SET DATABASE TO mydb

    ON ERROR DO FORM ERRORS WITH ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO(1)

    DO FORM SPLASH_FORM

    READ EVENTS

    CLOSE DATA ALL
    CLEAR ALL
    QUIT

     

    The hardware technician stated that the cache available on the server is not enough to allow my program to run as well as the other documents which the users access from the server.  There are currently 8 users which use the system.  The files on the server are dbf tables.

    Errors I have been having recently involve some such as:

     

    Error loading file - record number 89.  Left = 137 Top = 20 Width = 90 Height = 90 Alias = "receipt_q" CursorSource = ..\v_work_area\receipt_q.dbf Name = "Cursor1" <or one of its members>.Methods : Object file c:\officer_rec.fpt

    I run the same application on my system and it works.



  • Moving from VFP 5.0 to client/server