The Path field contains the result of the filecatalog( function for my folder (and subfolders) with Pan X data. DB contains only the file name without the suffix.
OK, I have modified my code:
loop
opensecret Pfad
setdatabaseoptions DB,"recompile",""
setactivedatabase DB
saveandclose ""
downrecord
until info("eof")
The loop is now much slower; it takes several seconds per record.
I am now seeing that those databases are reopened secretly (without windows). I can go to their datasheet using the View Open … / View Search menu items.
Once I have done that for one database, the next databases seem to open normally. So this issue is solved now for me.