2010-11-22 69 views
0

當用戶單擊名爲「Print」的命令按鈕時,我需要從VB6代碼中備份訪問數據庫。我在想,一個單獨的批處理文件將是理想的。如何導致批處理文件從VB運行?一旦批處理文件可以被激活,我應該能夠使用簡單的xcopy命令將數據庫複製到可移動的驅動器。所有幫助非常感謝。在VB6代碼中運行批處理文件

+0

Offtopic,但是當用戶點擊名爲「Backup」的按鈕時,應用程序應該執行什麼操作? – Arvo 2010-11-22 08:13:56

回答

5
Shell("path-to-batch-file", vbHide) 

當然,如果你不想隱藏它,這裏有一個選項列表。

vbHide    0 Window is hidden and focus is passed to the hidden window. 
vbNormalFocus  1 Window has focus and is restored to its original size and position. 
vbMinimizedFocus 2 Window is displayed as an icon with focus. 
vbMaximizedFocus 3 Window is maximized with focus. 
vbNormalNoFocus  4 Window is restored to its most recent size and position. The currently active window remains active. 
vbMinimizedNoFocus 6 Window is displayed as an icon. The currently active window remains active.