3 Replies Latest reply on May 14, 2014 8:13 AM by philmodjunk

    Divide a Database in 2

    JoaoB

      Title

      Divide a Database in 2

      Post

           Dear Sir or Madam

           At this point I am working with one database file. However I need to put some of the records in a different database file that works the same way.

           My questions are:

           1 - Can I change the name of the database file (AAABBB.fp7 to CCCDDD.fp7), it will work exactly?

           2 - If I change the name of the file the File Maker will recognize the folders where some of the images in the records are attached?

           3 - Finally If I copy the database file to a external drive and the respective folders with the images in the records, it will work fine? I get 2 databases exactly equal but in different physical spaces. This means I can erase the records in both databases and get 2 different databases that work exacly but with different records. Is this corrrect?

           Thank you vey much

           Joao B

            

            

            

        • 1. Re: Divide a Database in 2
          philmodjunk

               What problem are you trying to solve by doing this? (Sometimes there's a better way to get the same result that does not require two seperate databases)

               1) Probably correct, but it depends on the design of your database. There are some functions that you might use that include a reference to the name fo the database file. If you use such a function and put the name of the database file in quotes, that function will no longer return the correct value without being updated.

               Example: ValueListItems ( "fileNameGoesHere" ; "valueListNameGoesHere" )

               if your used it like this, however: ValueListItems ( get ( FileName ) ; "valuelistNameGoesHere" )

               then there is no problem with changing the file name as you didn't use the actual name in quotes.

               2) It appears that you have one or more container fields with files inserted with the "store a reference" option selected. Those container fields store a filepath to the location of the actual file. Changing the name of the database file will not affect these filepaths as they do not store the name of the database file, only the file path to the inserted file.

               3) If this is a Mac, that external volume will have a different name. If this is windows, odds are that the external drive will have a different drive letter. Both mean that once you move the files and their folders to the external drive, the file path to these files is now different and will no longer match the file paths in the container fields. You'd need to update the file paths in the container fields to use the new file paths. This could be done with a replace fields operation with a calculation specified that updates the file path in the container field just as though the container field is a text field.

               For more on container fields and file paths, see this thread: Exploring the use of a $Path Variable in Scripts

          • 2. Re: Divide a Database in 2
            JoaoB

                 Thank you very much,

                 But Im going to put my problem in another way:

                 1 - Im working with a database for a collection of artistic objects (Furniture Design and Graphic Art) - AAABBB.fp7 .

                 2 - Part of the collection (Graphic Art) wil be acquired by another collector and we need to provide the full inventory in a external hard drive (exacly like our database is organised)

                 3 - I believe in theory if I copy the database and delete the no Graphic Art records I can resolve the problem, correct? just need to find out the best and safest way to do it without loosing information, or malfunction.

                 4 - My current database AAABBB.fp7 Its organised like:

                 Inventory number plus a folder in the hardrive with the same name of the inventory number (example: Inventory Number is JJB-00345 the folder with files is JJB_00345).

                 The inventory layout has 2 fields for images, those images are linked to the folders in the hard drive (example: image 1 on the record JJB-00345 is linked to the image file on the respective folder JJB_00345 in the hard drive)

                 I figured out this solution because my computer was very old and slow. Also didn't find a way to create a container able to list and open from the container all kinds of files like media and large files (from pdf, to mov, or raw, docx, jpeg, and so on).

                 5 -  so at this point I'm afraid to do the following with out loosing information or malfunction:

                 A) > copy the database file AAABBB.fp7 to another external drive

                 B) > also copy the folder with inventory numbers folders

                 C) > erase the records of non Graphic Art

                 D) > change the name of the database file from AAABBB.fp7 to BBB.fp7

                  

                 6 - Another important doubt:

                 Some of the records have a inventory number with a sub reference - like JJB-00159/1; JJB-00159/2; JJB-00159/3; JJB-00159/4; JJB-00159/5, and so on..- In this particular situation one of the Graphic Art items is composed by 200 different posters (it works like a huge puzzle). The problem is when we want to filter the inventory and see only ...JJB-00158; JJB-00159; JJB-00160 (we can´t - we have to see the 200 records associated to the  JJB-00159 )

                 I figured out a solution:

                 in the layout there's now a dropdown menu so we can choose between "Inventory" ant "Sub-Inventory" - the problem is when I perform search by that field and choose "Inventory" the File Maker gives me back both categories "Inventory" and "sub-Inventory". What should i do to fix this?

                 Thank you very much

                 all the best

                  

                 Joao

                  

            • 3. Re: Divide a Database in 2
              philmodjunk

                   3) Without knowing more about the design of your database, I can neither agree nor disagree.

                   I particularly cannot follow what you are describing here:

                   The inventory layout has 2 fields for images, those images are linked to the folders in the hard drive (example: image 1 on the record JJB-00345 is linked to the image file on the respective folder JJB_00345 in the hard drive)

                   I figured out this solution because my computer was very old and slow. Also didn't find a way to create a container able to list and open from the container all kinds of files like media and large files (from pdf, to mov, or raw, docx, jpeg, and so on).

                   When you insert a file "by reference", you are linking that container field to a file. But you indicate that while you have "linked" to a file, you aren't using a container field.

                   So exactly how are you "linking" files to specific records in your database?

                   

                        I believe in theory if I copy the database and delete the no Graphic Art records I can resolve the problem, correct?

                   But I think the concern here is that when you move the graphics files linked to your database, the current file path to them may change and need to be updated to use the new file path. But what method you have used to "link" to these files is the key to answering that question and I do not know at this time how you are doing that. (perhaps a script uses Open URL to open the file or a web viewer is used? Or you really are using container fields?

                   6) Sorry, but again, I'd need to know a lot more about the design of your database before I can suggest much of an answer. From the very brief and general info provided thus far, I would guess that you will be looking at a two phase solution to this issue--a short term "band aide" to get what you want with minimal changes to the design of your database and a long term solution that restructures your data so that you don't have 200 different records with this ID in the same table--but instead set up a related table for listing members of a group of objects when logged as a single inventory item.