Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 28th, 2005, 02:49 PM
Registered User
 
Join Date: Jan 2005
Location: , , Netherlands.
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.

Reply With Quote
  #2 (permalink)  
Old January 31st, 2005, 10:02 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:10 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.