Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 28th, 2005, 02:49 PM
Registered User
 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How open a DOS-box from Access 2003

I've made a COBOL-programgenerator in Access 2003. Now I want to compile the generated sources by a COBOL-compiler. Therefor I must open a DOS-box and give several command.

My problem is, how can I open a DOS-box using Access 2003 VBA.

 
Old January 31st, 2005, 10:02 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You would need to start like this:

'==========================
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run("%comspec% /k ping /?"), 1, True
'==========================

This script opens Cmd.Exe, and Command.Exe (depending on which version you have) and then runs Ping Info. The /k keeps the window open, and to make it close automatically, you would use /c.

Create your code, then put it in a batch file, then use this code and call the batch file, probably using /c.


mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Rich Text Box Controls In Access 2003 sibrows Access 10 August 28th, 2007 03:46 AM
Send Keystrokes to DOS Program from Access VBA Cosmos75 Access VBA 6 May 15th, 2007 06:24 PM
Click even code for open DOS .EXE mohiddin52 Access VBA 4 October 18th, 2006 12:20 PM
Open the "Open File" dialogue box piratelordx Access VBA 4 March 14th, 2006 10:08 PM
Using VB6 SP2 to Open Access 2003 .mdb DWSTERRETT VB Databases Basics 1 June 13th, 2005 08:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.