Microsoft KB Archive/329791

= FIX: MSPersist does not handle special characters such as carriage returns or line feed correctly =

Article ID: 329791

Article Last Modified on 10/11/2005

-

APPLIES TO


 * Microsoft Data Access Components 2.7
 * Microsoft Data Access Components 2.7 Service Pack 1

-



This article was previously published under Q329791







SYMPTOMS
When you try to fetch data that contains special characters such as carriage returns or line feed by using Microsoft ADO and the Microsoft Data Access OLE DB Persistence Provider (MSPersist), users may receive the following error message:

Run-time error '-2147467259 (80004005)': An invalid character was found in text content.



CAUSE
This behavior occurs because Microsoft Data Access OLE DB Persistence Provider (MSPersist) invokes Microsoft XML Parser (MSXML) 3.0 in Microsoft Data Access Components (MDAC) 2.7. MSPersist invokes MSXML 2.6 in MDAC 2.6. MSXML 3.0 enforces the XML spec wherein it does not permit characters below 0x20H, with some exceptions.



RESOLUTION
A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Data Access Components (MDAC) service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question. The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.   Date         Time   Version            Size    File name --  09-Oct-2002  23:56  2.71.9031.7       180,224  Msdaprst.dll



WORKAROUND
There is no workaround.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section of this article.



MORE INFORMATION
When you use Microsoft SQL Server 2000 Analysis Services together with the Microsoft OLAP Provider by using the drillthrough functionality, the record that contains the special characters is not displayed. No errors or warnings are displayed.

Steps to reproduce the behavior
 Start a new standard .exe project in Microsoft Visual Basic. By default, that is named Form1 is created. Add a CommandButton control to Form1.  Paste the following code in the General Declarations section of Form1: Private Sub Command1_Click Dim rs As Object Set rs = CreateObject(&quot;ADODB.Recordset&quot;)

With rs   .Fields.Append &quot;Test&quot;, 201, 256 .Open .AddNew .Fields(&quot;Test&quot;).Value = &quot;Some Value 1&quot; .AddNew .Fields(&quot;Test&quot;).Value = &quot;Some Value 2&quot; .AddNew .Fields(&quot;Test&quot;).Value = Chr(12) 'Inserting the special character here. .Save &quot;C:\MyFileName.txt&quot;, 1 .Close End With

Set rs = Nothing Set rs = CreateObject(&quot;ADODB.Recordset&quot;) rs.Open &quot;C:\MyFileName.txt&quot; rs.MoveFirst For i = 1 To 3 Debug.Print rs.Fields(0).Value rs.MoveNext 'Will Error on the third record Next i rs.Close End Sub </li> Run the application. Notice that you receive the error message that is mentioned in the &quot;Symptoms&quot; section.</li></ol>

Additional query words: mspersist line feed carriage return special crlf cr/lf

Keywords: kbbug kbfix kbqfe kbhotfixserver KB329791

-

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

© Microsoft Corporation. All rights reserved.