ACC: OpenDatabase and CloseDatabase Pseudo ActionsLast reviewed: June 3, 1997Article ID: Q100148 |
The information in this article applies to:
SUMMARYAdvanced: Requires expert coding, interoperability, and multiuser skills. Microsoft Access includes two "pseudo actions," or dynamic data exchange (DDE) commands, called OpenDatabase and CloseDatabase. These commands are available through the DDE SYSTEM topic, and allow you to open and close Microsoft Access databases over a DDE channel.
MORE INFORMATIONThe syntax for the OpenDatabase and CloseDatabase pseudo actions is
OpenDatabase <Database_Location> CloseDatabasewhere <Database_Location> is the path and filename of the Microsoft Access database to be opened. The CloseDatabase action does not take a parameter since Microsoft Access can have only one database open at a time. The following sample Microsoft Excel macro demonstrates how the OpenDatabase and CloseDatabase pseudo actions work. NOTE: This macro will not work with Microsoft Access version 1.0.
The command in cell A5 opens the sample database Northwind.mmdb (or NWIND.MDB in version 1.1 and 2.0) in the current working folder (directory), using the OpenDatabase pseudo action. The command in cell A6 runs the "Sample AutoExec" macro in the Northwind.mdb. The command in cell A7 closes the currently opened database file using the CloseDatabase pseudo action. The commands in cells A8-A10 terminate the DDE channel, activate the Microsoft Excel application, and end the macro. For more information about Using Microsoft Access as a DDE Server, search the Help Index for "servers, DDE," or ask the Microsoft Access 97 Office Assistant.
|
Additional query words: ole/dde server
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |