Microsoft KB Archive/101372: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
Line 12: Line 12:
<div id="TitleRow">
<div id="TitleRow">


= <span id="KB101372"></span>ADT: Use &quot;MSACCESS&quot; in DDEInitiate w/ Run-Time App (1.0, 2.0) =
= <span id="KB101372"></span>ADT: Use "MSACCESS" in DDEInitiate w/ Run-Time App (1.0, 2.0) =




Line 47: Line 47:
Advanced: Requires expert coding, interoperability, and multiuser skills.<br />
Advanced: Requires expert coding, interoperability, and multiuser skills.<br />
<br />
<br />
Applications can initiate a dynamic data exchange (DDE) conversation with a run-time application developed with Microsoft Access by specifying &quot;MSACCESS&quot; rather than the .MDB file, as the application name.
Applications can initiate a dynamic data exchange (DDE) conversation with a run-time application developed with Microsoft Access by specifying "MSACCESS" rather than the .MDB file, as the application name.


</div>
</div>
Line 61: Line 61:
== MORE INFORMATION ==
== MORE INFORMATION ==


To communicate with a run-time application using DDE, it is strongly recommended that you use the name of the .MDB file, not &quot;MSACCESS,&quot; as the application name when you are initiating a DDE conversation.<br />
To communicate with a run-time application using DDE, it is strongly recommended that you use the name of the .MDB file, not "MSACCESS," as the application name when you are initiating a DDE conversation.<br />
<br />
<br />
The run-time version of Microsoft Access responds to both Microsoft Access and the name of the .MDB file as the application name.
The run-time version of Microsoft Access responds to both Microsoft Access and the name of the .MDB file as the application name.
Line 69: Line 69:
<li>Start Microsoft Access and open the sample database NWIND.MDB.</li>
<li>Start Microsoft Access and open the sample database NWIND.MDB.</li>
<li>In the Database window, choose the Macro button and select Sample AutoExec from the list.</li>
<li>In the Database window, choose the Macro button and select Sample AutoExec from the list.</li>
<li>From the File menu, choose Rename. In the Macro Name box, type &quot;AutoExec&quot; (without the quotation marks), and then press ENTER.</li>
<li>From the File menu, choose Rename. In the Macro Name box, type "AutoExec" (without the quotation marks), and then press ENTER.</li>
<li>Quit Microsoft Access.</li>
<li>Quit Microsoft Access.</li>
<li>In Program Manager, choose Run from the File menu.</li>
<li>In Program Manager, choose Run from the File menu.</li>
Line 85: Line 85:
       Function DDEWithNWIND ()
       Function DDEWithNWIND ()
         Dim chan
         Dim chan
         chan = DDEInitiate(&quot;MSACCESS&quot;, &quot;NWIND;TABLE Employees&quot;)
         chan = DDEInitiate("MSACCESS", "NWIND;TABLE Employees")
         MsgBox DDERequest(chan, &quot;FirstRow&quot;)
         MsgBox DDERequest(chan, "FirstRow")
         DDETerminate chan
         DDETerminate chan
       End Function
       End Function
Line 99: Line 99:


NOTE: The run-time application responds correctly to the DDEInitiate() statement that reads:
NOTE: The run-time application responds correctly to the DDEInitiate() statement that reads:
<pre class="codesample">chan = DDEInitiate(&quot;NWIND&quot;, &quot;NWIND;TABLE Employees&quot;)
<pre class="codesample">chan = DDEInitiate("NWIND", "NWIND;TABLE Employees")
                 </pre>
                 </pre>



Revision as of 09:21, 20 July 2020

Knowledge Base


Article ID: 101372

Article Last Modified on 6/13/2001



APPLIES TO

  • Microsoft Access Distribution Kit 1.1
  • Microsoft Access Developer's Toolkit 2.0



This article was previously published under Q101372

SYMPTOMS

Advanced: Requires expert coding, interoperability, and multiuser skills.

Applications can initiate a dynamic data exchange (DDE) conversation with a run-time application developed with Microsoft Access by specifying "MSACCESS" rather than the .MDB file, as the application name.

STATUS

This behavior is by design.

MORE INFORMATION

To communicate with a run-time application using DDE, it is strongly recommended that you use the name of the .MDB file, not "MSACCESS," as the application name when you are initiating a DDE conversation.

The run-time version of Microsoft Access responds to both Microsoft Access and the name of the .MDB file as the application name.

Steps to Reproduce Behavior

  1. Start Microsoft Access and open the sample database NWIND.MDB.
  2. In the Database window, choose the Macro button and select Sample AutoExec from the list.
  3. From the File menu, choose Rename. In the Macro Name box, type "AutoExec" (without the quotation marks), and then press ENTER.
  4. Quit Microsoft Access.
  5. In Program Manager, choose Run from the File menu.
  6. Type the following line, and then press ENTER:

    C:\<ACCESS>\MSARN100.EXE NWIND.MDB

    where <ACCESS> is your Microsoft Access program directory.
  7. Start Microsoft Access again and create a new database, or open a database other than NWIND.MDB.
  8. Create or open a module and add the following Access Basic function:

          Option Explicit
    
          Function DDEWithNWIND ()
             Dim chan
             chan = DDEInitiate("MSACCESS", "NWIND;TABLE Employees")
             MsgBox DDERequest(chan, "FirstRow")
             DDETerminate chan
          End Function
                        
  9. From the View menu, choose Immediate Window. Type the following line, and then press ENTER:

     ? DDEWithNWIND()

    Note that a message containing the first record from the Employees table in NWIND.MDB is displayed.

NOTE: The run-time application responds correctly to the DDEInitiate() statement that reads:

chan = DDEInitiate("NWIND", "NWIND;TABLE Employees")
                

Keywords: kbprb kbusage KB101372