What are you trying to do with this script?
Are both Picture 1 container fields set up with external storage or is DB2::Picture1 not externally stored?
If so, might some of the files in DB2 have been inserted or imported with the "Store a reference" option enabled?
I'm trying import pictures from DB2 into DB1.
DB2 isn't set up for external.
How do I make sure that all the files are not stored as a reference and simply transferred in the DB1?
I'm not actually sure that store a reference files will fail to copy over to an externally stored container field, I'd have to test that and see. Since your target field is not externally stored, this is no longer a relevant concern anyway. But is it possible that you have references to files in DB1 that are no longer valid? (The referenced file was renamed or moved...)
It's possible to tell that a container field has a file reference instead of an embedded file but takes a bit of doing. If you defined a calculation field in DB1 with this simple expression:
and select text as the result type. This calculation field will show a file path to a file if "store a reference" was used to insert or import the file.
What I see in this script, BTW, looks like something that could be done with a single Import Records operation if you used the "match records in found set" option.
I will have to check out what it's doing. I'm not where I can get to the database.
I have tried the import Records as well. I also tried Copy and Paste. Nothing was successful. I'm still getting the message.
I would expect Import Records to produce identical results as your script. I mentioned it as it's a simpler set up.
You can check a specific record's container field using FileMaker Advanced's data viewer if you add a watch expression such as:
GetAsText ( DB1::picture1 )
Can you provide a more detailed description of your database and what you have set up here?
Are you getting this on every record or just some records?
Do you see it in DB1 or only in DB2?
Are both DB1 and DB2 located in the same folder on the same computer?
One "if all else fails" option is a looping script that uses export field contents to export Picture1 from DB1 to your computer's temporary folder and then inserts it from the temporary folder into Picture1 of DB2. That might resolve some file reference issues if, as I strongly suspect, you have some container fields with files inserted "by reference".
A few more questions:
Is there a relationship defined linking DB1 to DB2? If so, did you use this relationship?
On the layout that was current when you ran your script, was either "DB1" or "DB2" the text found in "Show Records From" in Layout Setup?
I think i got it! Thanks for the help on the troubleshooting. It looks like the DB2 was using just references rather than having the pictures in the database.