Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to Delete All Records in another file 1

Status
Not open for further replies.

jmbter

Technical User
Jun 24, 2005
17
US
I am trying to write a script to delete all records in another FMP 7 Database. Essentially the script will export records, re-import those same records, then either delete the records in the outside file or delete the entire file. I'd prefer the latter of the two, but will settle for either. BTW, "Opening File," "Delete All Records," "Close File" does not accomplish this task. Any ideas?
 
To delete a file you can use SEND EVENT with a calculation something like this:

"cmd /c del c:\Folder\NextFolder\file.fp7"

This will delete your entire file. This is pretty dangerous so be sure you really want to delete the entire file. Be aware that everyting gets deleted, not just data.

-Striker
 
Hey Striker,

Will that work to solve my problem of being able to rename a file? Is there a rename file command from the command line?

See the thread before this one.

Joe
 
Yup the syntax is:

Ren OldName.ext NewName.ext

Note: This must be run from the folder where the file is located.

To get help on these commands do this:

START -> RUN
Open: Type "CMD" without the quotes then press OK.
At the prompt type "REN /?" without the quotes then press enter.

To exit the command shell simply type "exit" without the quotes and press enter.

-Striker
 
Hi TStriker,

I need a little more help on this one. I'm using Filemaker 6.0 Windows. I don't have a Send Event to choose from. I do have Send DDE. I tried that but it doesn't work. I can get it to work by typing in the syntax using the "Run" command in Windows so I know my syntax is correct.

If it's "Send DDE" I use, can you help me out on what to enter in the "Service Name", "Topic", & "Commands"

Here is the data my calculation creates:

"CMD /C REN C:\pd_oracle\audio_files\drop_off_window\Test\05-12347-1240-43.dvf 05-12349-1240-43.dvf"

Basically I'm trying to change the file 05-12347-1240-43.dvf to 05-12349-1240-43.dvf

Thanks for your help.

Joe
 
Hello Joe,

Sorry for the delayed response but I've been busy for the past couple of days.

With version 6 you should be able to use the script step called "Send Message". This is exactly the same as "Send Event" in version 7. The only difference is how its named.

In my opinion but names are deceiving but especially send message. One would think its about sending a message to another user but what its really about is sending a command to the operation system.

-Striker
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top