Microsoft KB Archive/101087

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

PRB: Cannot DDEPoke More Than 255 Characters of Text

Article ID: Q101087
Creation Date: 04-JUL-1993
Revision Date: 19-SEP-1996 The information in this article applies to:

  • Microsoft Access versions 1.0 and 1.1
  • Microsoft Access Distribution Kit version 1.1

SYMPTOMS


When an Access Basic function uses the DDEPoke statement to send data to another application, Microsoft Access will not send more than 255 characters. Any data beyond the 255th character will not be sent. No error message will be generated.

RESOLUTION


Although the DDEPoke statement will not send more than 255 characters, you may be able to use the DDESend() function instead. The DDESend() function, which can only be used from the ControlSource property of a text box on a form, is capable of sending more than 255 characters. The following example demonstrates how to use the DDESend() function to send characters to Microsoft Word for Windows.

  1. Start Microsoft Word for Windows. Word for Windows will open with an empty document named Document1.
  2. From the File menu, choose Save As, and then enter DOC1 as the file name.
  3. From the Insert menu, choose Bookmark, and type "test" (without the quotation marks) in the Bookmark Name box.
  4. Start Microsoft Access, leaving Word for Windows running, and create a blank, unbound form with a text box.
  5. Type the following expression in the text box ControlSource property:

    NOTE: In the following sample code, an underscore (_) is used as a line-continuation character. Remove the underscore when re-creating this code in Access Basic.

          =DDESend("winword","doc1","test",String$(255,"*") &_
          String$(100,"@"))
  6. View the form. If you switch back to Word for Windows you will see 255 asterisk (*) characters, followed by 100 at sign (@) characters.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions 1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION


Steps to Reproduce Behavior


  1. Start Microsoft Word for Windows 2.0. Word for Windows will open with an empty document named Document1.
  2. From the File menu, choose Save As, and then enter DOC1 as the file name.
  3. From the Insert menu, choose Bookmark, and type "test" (without the quotation marks) in the Bookmark Name box.
  4. Start Microsoft Access, leaving Word for Windows running.
  5. Create a new database, and create a new Access module.
  6. Add the following function to the module:

          Option Explicit
          Function DDEPokeTest ()
             Dim chan
             chan = DDEInitiate("winword", "doc1")
             DDEPoke chan, "test", String$(255, "*") & String$(100, "@")
             DDETerminate chan
          End Function
  7. From the View menu, choose Immediate Window.
  8. Type the following, and then press ENTER:

          ? DDEPokeTest()
  9. Switch back to Word for Windows and note that only 255 asterisk (*) characters display. The at sign (@) characters do not display.



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

©1997 Microsoft Corporation. All rights reserved. Legal Notices.


Additional reference words: 1.00 1.10
KBCategory: kbinterop
KBSubcategory: IntpOthr