Newsletter #6
File Names

This month I'll talk about the importance of file names in FileMaker. They're so important I like to say that file names are King. First I'll talk about some scenarios you might have run into that can cause problems. Along the way I'll talk about how to avoid those problems. Then I'll finish with an explanation of file recovery.

When working with versions of FileMaker starting with 3, you could build relationships between files. Even though versions 7 and later allow you to create multiple tables in one file, there are still plenty of reasons to build multiple files solutions. So you still need to take the file naming issue into account.

Why would you rename your files in the first place? Sometimes people rename files so the name more clearly represents the function. A second case would be if a file is damaged and part of the recovery process involves automatically naming the new file something like "Contacts Recovered.fp7." More on file recovery later.

If you have two files connected with a relationship and you rename one of the files, you can get into quite a pickle. One of two things happens; FileMaker can't find a file with a matching name, or it finds a different file with the same name as the old file. In the first case, you get a message telling you the file is missing. At least you know something is amiss. In the second case, FileMaker happily hooks up with the wrong file and it may be some time before you realize something major is wrong - sometimes days or even weeks!

Is it because FileMaker is stupid? Not really. What if one of your friends asked you to come visit them but they moved without telling you. Does that make you stupid? Of course not. You might question your buddy's intelligence though. It's the same with FileMaker. A file expects to find its friend file at the same file name as always. It's up to you to tell it if it has a new name. My advice is, unless you absolutely need to, don't rename any of the files in your solutions. (If you absolutely must rename a file, see my comments further down.)

A separate but similar problem can happen when related files get separated. Maybe you don't know they should be kept in the same folder or that they even belong together. But suddenly you get a message that a specific file is missing. Or again, FileMaker just looks around on the network until it finds a file with the same name.

For example, I got a call from a client who had hundreds of computers on a network. They complained that data they had entered was disappearing and that layouts were changing, too. When we went to the Open File dialog, we found four files all called "Contacts." It turned out that various departments had all started their own Contacts file. When my client's department started up their Invoice file, FileMaker would put the contact data in whichever Contacts file it found first on the network. No wonder they thought their data was gone and someone was changing their layouts!

Remember that Contacts is a very popular name for a file - as is Invoices, InvoiceLineItems and Inventory. Some developers name files with a two or three letter code that helps represent the purpose of the file. So "Contacts" might becomes "edContacts" to represent that it's for the Education department. If you're having a problem like that, don't just rename your file (unless you're at the very beginning stages of file building). You might be better off contacting me to help out.

Another problem I've seen is where someone creates backups that are sitting out there somewhere on the network. Early in my career it happened to me. We were testing an ordering system for a bakery and it seemed that orders were disappearing. Somehow the Contacts file had connected up with a backup of the Orders file we had over on a Zip disk and was merrily entering orders there.

For that reason, I recommend backups be compressed or (if it's on a hard drive) disconnected after the backup takes place. In the bakery example, all we needed to do was make sure the Zip disk was ejected before we opened the files and started testing. An alternative is to create backups in a folder that only an administrator has access rights to. And the administrator should understand how the process works. It won't do any good if they double-click one of the files to do some experimenting, only to find that the file is open and shared on the network!

One other scenario I've seen goes something like this; A file gets lost, damaged or renamed and you (or someone else in the office) gets a dialog that says, "Contacts.fp5 could not be found and is required to complete this operation." They just want to get on with their work. So when the File dialog comes up, they look around until they find some version of Contacts.fp5. Worse yet, I've even seen cases where they just clicked on any old file at all because they didn't know what else to do. Big problem!

OK. Let's say you're pretty smart about this. You know where to go to connect your file to the renamed file using the Define Relationships dialog. Guess what? All is still not well. Even though the basic relationship has now been connected, scripts and value lists won't be.

If your files are already well developed and you absolutely need to rename one or more files, you need a special tool called FileMaker Developer (or, starting with FileMaker 8, it's called FileMaker Advanced). And you'll need the specific version for the file type that you're working with. Since this process is not your everyday FileMaker work, I suggest you contact me to help you through it since I have every version from as far back as FileMaker 4.

Now I promised I'd explain about doing a Recovery. From time to time files can get damaged. If you entered little or no new data recently and there are no other changes to layouts in the file, it's probably best to just replace the damaged file with the most recent backup. (You do have backups, don't you?)

Barring that, you may have to perform a recovery.

1) Close all your files and open FileMaker. (If you're working with FileMaker Server, you'll need to stop the service and open the "client" version of the program.)
2) Go to the File menu and choose Recover. Find the broken file (let's call it Contacts), select it and choose Open.
3) You'll see a dialog asking where you want the file to go and suggesting you name it Contacts Recovered.fp5. I suggest you put it in the folder with the rest of the files.
4) Depending on the size of the file this can take anywhere from a few seconds to a few minutes.
5) Once it's done, minimize FileMaker and open the folder where the files live.

This is where everybody gets into trouble. They assume that since the file has been recovered, they're good to go. But when they open the solution, the other files are trying to connect up with Contacts which is still damaged. Instead, continue with the remaining steps.

6) Change the name of the damaged file to something like "ContactsBroke.fp5."
7) Change "Contacts Recovered.fp5" to "Contacts.fp5."

Now you can work as before.

That being said, I need to warn you that working with a recovered file is not recommended procedure. You should really use a clone of the file prior to the time it was damaged. Then you should export the data from the recovered file and import into the clone. If that's beyond you, well, you know who to call.

J **


Of course, the main purpose of this newsletter is to remind you that I'm here to serve your FileMaker needs - development, support, and training.

If you can think of anyone you might refer me to, I offer a 5% "Thank You!" for the first 2 years of billing on referrals.

< Back to In the News


Email us here.