3 Replies Latest reply on Aug 26, 2011 10:38 AM by philmodjunk

    Linked Databases / Server Side Script appears not to work

    StefanSmith4873

      Title

      Linked Databases / Server Side Script appears not to work

      Your post

      Hi

      I have a problem with a server side script running on a linked database. 

      I have two databases.  MASTER and SLAVE.

      In the master database I store some information in tables in SLAVE.  The linking it setup and works fine.

      I have a script that looks at some values in MASTER --- and creates NEW records in slave.  The fields in slave are simple - text, numbers, that's about it.

      If I open FMP Pro client and run the script it works beautifully!  No issues.  If I set the script to run automatically on FMP Server, no records are created at all!

      In fact, I have several linked databases and I have only just discovered the server scripts seem not to work.

      Now, all the databases I use have the same login username and passwords in each.

      When we interact with layouts this has meant that when information is accessed in another database we are not asked to login to that database.  So, I know in terms of permissions all works great.

      It's just the server script that doesn't work!

      We also access our databases remotely ---- again, all appers to work as in the background data is accessed from more than one database and we never have any persmissions problems or whereby the data cannot be accessed due to filepaths.

      The only problem I am having is when the server is running the script or scripts that would require using a table from one of the linked databases.

      Is there any reason why this would be?  I am fully aware somethings will not work on a server side script --- is one of those things access to a table that does not exist within the database I am using?

      And one final piece of information - all server side scripts we use have the same login information - and that login username and password is the same for ALL databases.  So in theory there should be no permission errors.

      Any help would be greatly appreciated.

      Thanks


      Stefan

        • 1. Re: Linked Databases / Server Side Script appears not to work
          philmodjunk

          Server scheduled scripts have a number of limitations that can make using them a challenge. One of them is that only relative path references to external data source references will work. If your FileMaker files are not all in the same folder, the references don't work. Also, you can not use Import records to move data from one file to another directly in a server scheduled script. If you pick your file locations carefully, it's possible to do it, but you have to export the data to a text file then import it from the text file into the destination file.

          See this knowledgebase article: http://help.filemaker.com/app/answers/detail/a_id/7035/kw/server%20import%20records

          The alternative to a server scheduled script is to set up a FileMaker Pro "robot file" that connects as a client to the hosted files and performs the needed script. Since this runs from a client session instead of on the server side, it does not have these limitations. You can use Windows Task Manager to schedule when such a robot file opens and runs on windows systems. There's also a Mac equivalent you can use for the same purpose.

          • 2. Re: Linked Databases / Server Side Script appears not to work
            StefanSmith4873

            Hi Phil

             

            Thanks for the reply!  All makes sense.  The files are not in the same folder which makes me regret not doing that in the first place!

            All of my databases run on the same physical hardware --- they are in their own folders.

            What is the easiest method for me to MOVE the SLAVE database into the same folder as MASTER?  I am not using the import records feature but I would like the scripts to work within the limitations you have outlined --- and there is nothing to stop me putting these databases into the same physical folder.

            SO --- that being the case, on the server, what is the easiest way to move the file?  Remove from database and reupload? Or is there a much easier trick?

             

            Thanks

             

            Stefan

            • 3. Re: Linked Databases / Server Side Script appears not to work
              philmodjunk

              You can use the admin console to close the files. Then just use your OS inteface to open the folder where they are located and move the files into a common folder. Then use the console to re-open them.