Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3733
  • Last Modified:

Open/run/launch vbscript file by calling it from Access VBA

Hi All,

I need to run a vbscript from MS Access 2003.  I generate the script in VBA and store it in an external vbs file.  I then want to run/open/launch the vbs file. (The file checks to see if the Access database's ldb exists.  If so, it sleeps and rechecks until the ldb doesn't exist.  It then copies the database to another location.)

I can't seem to get the proper syntax to run/open/launch the vbs file from VBA.  The script works correctly - I run it manually when Access VBA says it can't launch or find the script.  Any suggestions?

Thanks,

enrite
0
enrite
Asked:
enrite
  • 2
1 Solution
 
thenelsonCommented:
This should do it:
Shell "wscript " & Chr(34) & "Path and Name of script" & Chr(34)

However, did you know you can backup an open database with the MSDOS copy command?
0
 
enriteAuthor Commented:
Great!  And thanks for the MSDOS option...I didn't even think of that!

enrite
0
 
thenelsonCommented:
You're welcome.  Glad to help and thank you very much for the points with "A" grade!

Happy Computing!

Nelson

BTW:This is what I do to back up our database.  It may seem excessive but the data is critical to our business and I am very paranoid having been a system's engineer through the 70's and 80's when hard drive crashes were common.

The backend is stored on a raid 7 disk pack.  The server will email me if there is a problem.

Every half hour that the frontend is running, the frontend copies the backend to a raid 0 disk pack by shelling to the DOS copy command.  The DOS copy command will copy an open file.  The only time the copy is corrupted is when someone writes to the backend during the 30 seconds the copy is being made.  The database deletes copies that are more than two hours old so I always have the last 4 copies.  The database will email me if it runs into a problem.  (These copies are very useful for things like a user saying, "I just accidentally deleted everything in a memo field.")

Every night, a workstation runs MS backup zipping a copy of the BE to its harddrive.  I keep all these backups for the last four months.

Every night, another workstation runs Second Copy (www.centered.com) zipping a copy to a ftp site on our hosted www.nosuffering.com site.  Second Copy will email me if it runs into a problem.  The data center is in California.

Every night, a third workstation runs Handy Backup which compacts and repairs and then zips the file to a ftp site on my hosted www.thenelson.name site.  Handy Backup will email me if it runs into a problem.  The data center is in Pennsylvania.

I also look in on all the backups a couple of times a week.  This way, I am not relying on one computer or one piece of software for the backups.  I have automatic offsite backups at opposite ends of the country.  All of this has cost me $50 for Second Copy and Handy Backup and $9 a month for two hosted websites (which includes my websites www.nosuffering..com and www.thenelson.name).
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now