已答复 Visual Foxpro error loading fie

  • Monday, February 27, 2012 8:20 AM
     
     

    hi sir

    I am now converting my program from stand alone to network environment using visual foxpro version 9. My problem is I encounter  an "error loading file - record number 18 or sometime record number 1 or 2. Form1 <or one of its nembers>. Loading from or the data environment. File access is denied.\\clabpcc11\lccn-database\online-lcc.dbc." I encoutered this error when somebody will open the application in another terminal. please help me what shall I do.

    thanks !

    Mel P. Gerez

All Replies

  • Monday, February 27, 2012 8:43 AM
    Answerer
     
     

    Hi Mel,

    can it be, that you do not use a compiled EXE and instead let your users work within the regular VFP development window and let them start the forms via 'DO FORM...' command?


    Gruss / Best regards -Tom 010101100100011001010000011110000101001001101111011000110110101101110011

  • Monday, February 27, 2012 9:56 AM
    Answerer
     
     Answered

    When converting to a network environment, I have found it important to distinguish between the local machine environment and the network or server environment and the path to each folder.

    One of the first things I do in the MAIN initial program is to set various values as given here:

    m.gclclfldr = SYS(5) + SYS(2003)  && default drive + current directory of local folder path
    m.lsx3 = SYS(16) && executing program file name  on the network or server
    m.gcnetfldr = LEFTC(lsx3, (RATC("\",lsx3)-1))  && sets the network folder containing the exe file

    * the MAIN database .dbc file resides in the folder \Data

    m.gscurdb = m.gcnetfldr + '\Data\main'  && holds the path and name of the current database

    Then within a forms Dataenvironment - Method - BeforeOpenTables; I set the code

    DO setdataenvironment_cursordb WITH this

    This procedure changes the database path for all cursors within the data environment

    PROCEDURE setdataenvironment_cursordb
    LPARAMETERS lob

        FOR EACH objs IN lob.objects
            IF "Cursor" = LEFT(objs.Name, 6) then
                objs.Database = m.gscurdb + ".dbc"        
            ENDIF
        NEXT objs

    return

    Part of the reason for doing it this way is that users of my applications can select from various databases to open.

    Variables beginning with g are globals (I do not agree with not using globals) but you could easily put them in the applications main object or some such similair object.

    This approach also gets around the problem of having the same path name to the server on each PC.


  • Monday, February 27, 2012 9:38 PM
    Answerer
     
     

    It sounds like you have EXCLUSIVE ON in either your development environment or at runtime. You need to make sure that EXCLUSIVE is OFF if you want more than one person to be able to access a table at a time.

    Tamar

  • Tuesday, February 28, 2012 7:43 AM
    Moderator
     
     

    This rather sounds like OS problem...

    What is your OS and antivirus? Did you remove your app and data folders from antivirus checks? Did you switch SMB2 and oplocks off?