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

Posted on 2007-08-02
Last Modified: 2013-11-27
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?


Question by:enrite
    LVL 39

    Accepted Solution

    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?

    Author Comment

    Great!  And thanks for the MSDOS option...I didn't even think of that!

    LVL 39

    Expert Comment

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

    Happy Computing!


    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 ( zipping a copy to a ftp site on our hosted 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 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 and

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
    QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
    In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now