Normal Topic How do I FileOverwrite() to the server vs client (Read 465 times)
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
How do I FileOverwrite() to the server vs client
Jan 10th, 2008 at 11:52pm
Print Post Print Post  
Is there a way that I can make FileOverwrite() write to the server rather than the client?
- OR -
Is there a way to make @Macro() read the file from the client rather than the server?

Either one of these would solve my problem. I am constructing a macro file on-the-fly and writing it to disk. It works perfect in standalone mode, but bombs in Server/Client mode, because the macro file is being written locally to the client, then @Macro is looking for it on the server.

I tried using a series of QuickMacro commands instead of a macro file, but there is one spot that QuickMacro hangs and causes me to kill Sesame with Task Manager, where @Macro does not have this problem.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: How do I FileOverwrite() to the server vs clie
Reply #1 - Jan 11th, 2008 at 3:46am
Print Post Print Post  
Carl, I think that if you use the full path with @Macro, you can call the macros from the local client vs. the Server. But I would use UNC vs. drive letters so that C: definitely uses the local drive.  If UNC does not work then use SUBST to make a different drive letter for the local drive C.

I have no idea about having QuickMacro work with local folders.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: How do I FileOverwrite() to the server vs clie
Reply #2 - Jan 13th, 2008 at 3:39am
Print Post Print Post  
Thanks for the reply, Bob.

I wanted to create universal code that wouldn't depend on any external settings or tweaks to the network. I usually like to make Sesame self-sufficient.

I ended up with a workable solution. The code will simply need to run locally on the server machine at least once, in order to dynamically create the macro for that particular application's filename. After that, the macro will be there for the @Macro command to use, even though it might be a client that is invoking it. (The macro is still created and written to disk on the client, but that won't hurt anything anyway.)

This is for a client who (against my suggestion) really wants to use a new copy of the database for every group of people. I have no idea what names for those databases that she might use, so I needed to figure out something that would build itself.

The code is for a simple "Backup this Application" button, which automatically makes a backup copy of the application with the original name, followed by " Backup". (Clever name, huh?) The one thing that I can't make SBasic do without a macro, is type the name of the backup file, and select Yes to overwrite the old one. I know that there is a new command in Sesame 2.x called BackupApplication(), but I really don't like the way it works. It keeps creating brand new copies of the application, instead of simply overwriting one copy. With a large application, you can quickly run up a lot of disk space usage.

They could always use File/Save As, or backup from the command tree, but if they have lots of applications (as they will with their chosen method), that can lead to mistakes as to which file gets overwritten. So, I like to make it idiot-proof, and put code in a command button that does it for them.


  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged