Subject Re: Copy an image field from one table to another
From Mervyn Bick <invalid@invalid.invalid>
Date Sat, 17 Apr 2021 14:29:29 +0200
Newsgroups dbase.getting-started

On 2021/04/17 05:44, roy price wrote:

> Thanks Mervyn,
> I managed to get a non-corrupted version reconstructed with your help, starting with a backup from a while ago, the subsequent backups also had the same problem. The file mostly worked, hiding the problem, it was only when I tried to copy it to another name that the failure occurred.

It's good to hear that you've sorted the problem out.  It has
highlighted the need for frequent backups.  The more recent the backup,
the less work required to bring the restored table back to being current.

If you have the original image files on your harddrive you should give
serious consideration to adding a character field to your main table to
hold the path and image file name for each image.  This doesn't have to
completed in one sitting as your original setup will continue to work.

Once you have the new field, instead of assigning the imagefield to the
image control's datasource property with something like

dataSource = form.query1.rowset.fields["image"]

you would use the onNavigate event handler of your main table to assign
the correct image to the image control as each record is selected.

Something like

function rowset_onNavigate(type, nRows)
    this.parent.parent.image1.dataSource = "FILENAME
"+this.fields['image_path'].value
       return

With the new field populated you will be able to delete your image files
and never have to worry about one of them being corrupted in future.

Mervyn.