AJB_UMASS Posted May 5, 2005 Posted May 5, 2005 Is there a way to test for the existence of an import file, before actually trying to perform an import? We have a FM DB that is supposed to clear out all previous records, before loading a fresh set from a text file copied to the server from other machines. There's no point in deleting the old records if the new ones are not yet available (for whatever reason); since the old import source files are deleted after every successful import, how can we see if the new ones have arrived, so that we don't prematurely erase the old data?
gstb Posted May 27, 2005 Posted May 27, 2005 If on the Mac you can use an AppleScript to do your import, or at least test for it: tell application "Finder" set importfile to "Reese_p1:Users:reese:Documents:ProductionSchedule:Saved:JobInfo.fp7" if file importfile exists then display dialog "your import command here" else --option function here, like email the admin end if end tell Note that I defined the file path as a text string, not as a file. If it were a file then the script would error if the file does not exist. Reese
-Queue- Posted May 27, 2005 Posted May 27, 2005 It seems like it would be simple enough to Set Error Capture [On] Import Records If [Get(LastError) <> 100] Show Omitted Only Delete All Records End If If the file exists (error does not equal 100), then the previously existing records are deleted after the import is performed.
Recommended Posts
This topic is 7122 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now