Topics Supported by Access as a DDE Server 

Summary:

Access supports dynamic data exchange (DDE) both as a client and as a
server. This article lists the five topics that Access supports as a
DDE server and the items that are valid on each of those topics.

This article does not explain what DDE is or how to implement it. For
more information on DDE, query on the following words in the Microsoft
Knowledge Base:

   DDE and <the name of application you want to use as a DDE client>

For information on using Access as DDE client, refer to Chapter 13 of
the "Microsoft Access User's Guide." For information on using Access
Basic code to exchange data with other applications, see to Chapter 9
of "Microsoft Access: An Introduction to Programming."

More Information:

The five topics supported by Microsoft Access are "System",
<Database>, <Table Name>, <Query Name>, and "SQL <statement>". Below
are descriptions of the five topics and the items that are supported
in each.

System
------

System is a standard topic for all DDE server applications. It returns
a list of the topics supported by Access. Valid items with the
System topic are as follows:

  SysItems - Returns a list of items supported by the topic "System"
  Formats  - A list of the formats Microsoft Access can post to the
             clipboard.
  Status   - Busy or Ready.
  Topics   - A list of all open databases.

In addition to requesting the four items above, you may send the name
of a macro to Access over a DDE channel initiated on the topic
System. If the macro is contained in the currently open database it
will be executed. A macro name is a valid item on each of the five
topics supported by Access.

<Database>
----------

<Database> is the filename of an existing database. This can be a
fully qualified pathname to the file and may include the .MDB
extension. You cannot query the SYSTEM.MDB via DDE. After you have
initiated a DDE link with a database, you may request a listing of the
objects in that database.

   TableList   - List of table*
   QueryList   - List of queries
   MacroList   - List of scripts
   ReportList  - List of reports
   FormList    - List of forms
   ModuleList  - List of modules

   MacroName - You may also send the name if a macro to be executed.

<Table Name> and <Query Name>
-----------------------------

These topics support the same items. When requesting the contents of a
table or the results of a query, you must specify the database the
object is in, followed by a semicolon (;), the keyword TABLE (or
QUERY), and then the name of an existing table or query:

   [db Name];TABLE <tbl/qry name>  or   [db Name];QUERY <tbl/qry name>

Examples: NWIND;Table Categories
         c:\Access\NWIND.MDB;Query Category List

Note: Do not place brackets ([ or ]) around table or query names.

You may specify the following items:

    All         - All the data in the table including the column
                  names.
    Data        - Returns all rows of data without the column names.
    FieldNames  - A list of Columns.
    NextRow     - Returns only the next row in the table/query. When
                  the conversation is first started NextRow returns
                  the first row. If the current row is the last record
                  and NextRow is executed the request will fail.
    PrevRow     - Returns only the previous row. If PrevRow is the
                  first request ever a new channel the last row of the
                  table/query is returned. If the current row is the
                  first record the request for PrevRow will fail.
    FirstRow    - Returns data in the first row of the table/query.
    LastRow     - Returns data in the last row of the table/query.
    FieldCount  - Count of columns in the table/query.
    MacroName   - You may also send the name if a macro to be
                  executed.

"SQL <expression>"
------------------

This topic will return the results of the specified SQL expression.
The syntax for SQL is [db Name];SQL <expression>.

Examples: NWIND;SQL Select * from Employees;
          c:\ACCESS\NWIND.MDB;SQL Select [First Name] from Employees;

Note: All SQL statements must end with a semicolon (;).

The Items supported on the Topic SQL are the same as those for <Table
Name> or <Query Name>.
