8 Replies Latest reply on Feb 21, 2012 7:24 AM by ScottRohlfing

    "File not found" message from host file when accessed by client file

    ScottRohlfing

      Title

      "File not found" message from host file when accessed by client file

      Post

      I have two data files, one is a host on FM11 being accessed remotely by the client file residing on other machines including FMGo. I have records in the host file that contain fields that contain auto-enter lookup values from a related field in the client file. (The purpose of this is to create duplicate records that have been created by clients).

       
      The problem is the FIRST time the client creates a new record in the host file and inserts a value into the related field, the host database can't find the client to lookup the value. I get a dialog box saying file not found and then have to manual select the file after which it works great. Any new records created after that will work just fine as the host now knows the location of the client apparently.
       
      So my question is this, is there some way to tell a remotely accessed host database the location of the client that it has the relationship with in a script so that the user doesn't have to manually tell the host where the client is the first time? I understand how to manage external data sources with known locations, but you never really know where the client will be therefore I need a way to tell the host without the user being interrupted with the dialog box, "The file <filenamehere> could not be opened. (not found)" the first time its accessed.
       
      Thanks.
       

        • 1. Re: "File not found" message from host file when accessed by client file
          philmodjunk

          This looks difficult to pull off without a lot of issues with those separate copies of the client file on each local machine. Putting that file on the hosted machine, if possible, would make for much simpler data handling. (And yes, that may not be possible if you need access to the data from locations that do not have wireless access (3G or WiFi) to the server hosting the file.)

          With the client file on the client machine, you need valid file paths to that machine on every device--might be tricky for your ipads and also an issue if you have both mac and windows client machines as the file path structure differs slightly for each OS.

          You can examine and work with external data source references if you open manage | External datasources. Open your host file and check these settings. You can "layer" multiple data source references if you wish, so you can set up a different reference entry that works for each machine all within the same data source reference. FileMaker will try each reference in turn until it either finds one that works or reaches the end of the list. When it reaches the end of the list is when you'll see your "file not found" message.

          The big achilles heel here is that if a user moves or renames their client file, it will no longer be accessible from the hosted file.

          • 2. Re: "File not found" message from host file when accessed by client file
            ScottRohlfing

            I guess thats the answer I didn't want to hear. :(  The client file does need to function when away from 3G or WiFi so it can't reside on the host machine. It appears as though my only alternative may be to "push" the data to the host with a set field name rather than "pull" the data with a look up?

            • 3. Re: "File not found" message from host file when accessed by client file
              philmodjunk

              Not if you can set up the external data source references so that they work with each client machine and you can keep your users from moving/renaming the client file.

              • 4. Re: "File not found" message from host file when accessed by client file
                ScottRohlfing

                The client machines are iPads that roam. I never know when, where or how they will be hitting the host file.

                • 5. Re: "File not found" message from host file when accessed by client file
                  philmodjunk

                  But you know what the file is named and that should be sufficient for the iPad if you set up the external data source reference correctly. You may have to repost that part of this question in the FM GO forum unless you have already done so. I don't use GO, I know the file structure for such iOS devices differe from full up computers but don't know the exact format to use in the data source entry. I'd use the relative path entry as the first line which is just:

                  file:Filename

                  As far as I know, that should work for those devices, but you'll have to try it out to see if it works for the iPads.

                  • 6. Re: "File not found" message from host file when accessed by client file
                    ScottRohlfing

                    Turns out the iPad and FMGo are irrelavent because I get the same error when running the client file on a laptop with FM. The data source entry is file:Filename but the host doesn't find the client. Once I tell it manually from the client, then it finds it all day long until I quit the client file. When I run the client file again the first time I get the "file not found" error. Since the client accesses the host several times to get other data before the lookup is called you would think the path would be known by the host. But as soon as I use a lookup it gets stupid and I need to manually tell it where the file is located (which is on the device that called it in the first place!).

                    • 7. Re: "File not found" message from host file when accessed by client file
                      philmodjunk

                      Yes, Forgot that for a relative path, you are telling the system to open the file that is located at the "same place as the current file". And that's on the server--not the client for the hosted file.

                      I can fix this for Mac and Windows machines but don't know if there's a workable way to do this on the iPad machines.

                      From one of the machines, open the hosted file, then open manage | external datasources

                      Find the reference to your file, select it and click edit.

                      Click Add file, navigate to your local database file and select it in the open file dialog that pops up.

                      This reference will now work for the current machine and any other client machines with the same file path. If you go to each client machine that still pops up the "not found" message and repeat this process, adding more "layers", you can eradicate this error for all client mac and windows machines provided the user does not move or rename the file. If you can locate the file on a spot that has the same exact path on every machine, this get's a lot simpler.

                      But I don't know what "path" if any will work for the iPads. Maybe someone on the FMP GO forum (see tab at top of this screen) will know if this can be done or not.

                      • 8. Re: "File not found" message from host file when accessed by client file
                        ScottRohlfing

                        So just to bring this to a close, I ended up rewriting that portion of the script and changing the fields so that now the client "pushes" the data to the host using Set Fields rather than having having the host file fields "lookup" from the client. 

                        My path problems are gone.

                        Phil thanks for your assistance. Our discussion made me realize I was probably heading down the wrong path. Surprised