Microsoft KB Archive/280309

= PRB: _VFP.DataToClip Only Reads DataSession 1 =

Article ID: 280309

Article Last Modified on 11/27/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q280309



SYMPTOMS
The DataToClip method is not able to access data in a private data session.



CAUSE
Because DataToClip is associated with the Application Object (_VFP), it only has access to the data in the Object's DataSession, which is DataSession 1.



RESOLUTION
One workaround is to write a routine that converts each field to character type (the Transform function does this easily in Visual FoxPro 6.0), concatenates the information, and stores it to the _CLIPTEXT variable.



Steps to Reproduce Behavior
To display this behavior, paste the following code in a .prg file and run it: CLOSE DATA ALL _CLIPTEXT = &quot;&quot;

loForm = CREATEOBJECT(&quot;MyDSForm&quot;) MESSAGEBOX(_CLIPTEXT)

DEFINE CLASS MyDSForm AS form DataSession = 2 PROCEDURE Init USE HOME + &quot;labels&quot; *!* Because we did &quot;CLOSE DATA ALL&quot; at the top of the program, *!* there is no data in the default session to read. _VFP.DataToClip *!* If you uncomment the next line, you will receive an error. *!*  _VFP.DataToClip(&quot;labels&quot;, 100) ENDproc ENDdefine

Keywords: kbxbase kbprb KB280309

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.