When the solution matters

Tips...

Registration Documentation Knowledgebase Seminars / Training Technical Support Partner Central

Data

How do I fix errors retrieving data, sorting or searching?

If your code is correct but you are receiving error messages trying to search for or retrieve data, it is possible that your data file has become corrupted. This is usually due to 4D quitting unexpectedly (perhaps due to a loss of power or because of a crash), while it is part-way through saving the content of the database. In this case, part of the database will not be correctly structured for 4D to find the information it is looking for, or the content of that information may be incorrect.

You should always protect valuable data very carefully. Frequent backups are your first line of defense, and these backups should be kept in different places, and possibly even in different forms. 4D Backup is a great way to backup a 4D Server-based database. It is also a simple matter to get 4D to write all of the records from a table to a file, using SEND RECORD and RECEIVE RECORD commands, or using the Export menu command from user mode. In 4D v6.5, Triggers can easily allow you to time and date-stamp changes to a table, in which case you can regularly export the records which have changed. Some or all of these strategies should be adopted with any database containing important data.

If you are running 4D Server, the Backup plug-in, now free with 4D Server v6.5, can make automatic backups for you, and can also create a log file, which records moment- by-moment everything that has been done to the database since it was last backed up. In the event of a problem, it is a fairly easy matter to restore the backup copy of the database, and then integrate the log file, which restores the changes made since that backup. In this way, you can obtain a valid data file, which should reflect all but the last few minutes of work.

In some cases, your best efforts at backing up your data can fail, and you will need to repair a data file. Before you begin trying to fix a damaged data file, you should always make a copy of that file, just in case one of your efforts to repair it are unsuccessful, which can in some cases make matters worse. After you think you have repaired the data file, you should carefully check whether any important information has been lost, and whether you can now perform the operation that was producing an error. Once you are confident that your data file has been repaired, you can then work with the new data file and (if storage space is tight), delete the old data file. If you have somewhere to archive this file, it is often a good idea to keep it, just in case you discover later that some important data in it is now missing.

After you have decided to start trying to repair a data file, you have a few options:

Command Using Send/Receive Record to Recover, Replace or Update

 


International | Company | Contact 4D | Site Map | Privacy Policy | © 4D UK 1995-2008 | Change font size: [A] [A] [A] | Print this page