The information in this article applies to:
SUMMARY
FoxPro for Windows can be used as a dynamic data exchange (DDE) server if
DDEDATA.APP is run before the DDE link is established from Microsoft Excel.
DDEDATA.APP, which is included with FoxPro for Windows, sets up FoxPro as a
DDE server.
MORE INFORMATIONSet Up FoxPro as a DDE ServerTo set up FoxPro as a server, perform the following:
Connect to FoxPro from Microsoft Excel Using Visual Basic for ApplicationsIn Microsoft Excel, type the following lines of code in a Visual Basic for Applications module sheet in a workbook:
The DDEInitiate() command opens a channel to FoxPro. The first argument,
the application or service name, is "ddedata" because DDEDATA.APP is
running in FoxPro. The second argument, the topic, is the path to the
database table, followed by a semicolon, and then the table name. The
variable ChannelNumber contains a numeric value that represents the DDE
channel link.
The DDERequest() command's first argument is the channel number (or its variable). The second argument is the requested item. Items that can be requested include: ALL, DATA, FIELDCOUNT, FIELDNAMES, FIRSTROW, LASTROW, NEXTROW, and PREVROW. Other topics can be programmed within FoxPro beforehand. This example requests the information from the first row of the database, which is returned to Microsoft Excel in an array. The For ... Next loop retrieves the information and places it in the active sheet of the workbook. This macro should be run from a worksheet, not the module sheet, through the Tools and Macros menu options. REFERENCES
FoxPro for Windows "Developer's Guide," version 2.5, pages D12-12 to D12-20
Additional query words: FoxWin 2.50 2.50a 2.50b
|
|
Last Reviewed: August 25, 1999 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |