Microsoft KB Archive/318558

= The DefinedSize property for strings in COMTI recordsets is set to one extra character =

Article ID: 318558

Article Last Modified on 6/21/2004

-

APPLIES TO


 * Microsoft Host Integration Server 2000 Standard Edition
 * Microsoft Host Integration Server 2000 Service Pack 1

-



This article was previously published under Q318558



SYMPTOMS
When Microsoft COM Transaction Integrator (COMTI) creates an ADODB recordset, the DefinedSize property for a string field is set to one character more than what is defined in the COMTI type library. When you use the recordset to provide input to the COMTI method and then a string field is filled with string data for the number of characters that is specified in the DefinedSize property, the COMTI method call will fail and you will receive a COMTI 102 error message that contains the following description if the COMTI string parameter has not been set to truncate additional data:

(1513) Character string parameter AcctRS in method getaccts exceeds the maximum size; truncation is not allowed. The COM Transaction Integrator runtime has determined that the length of the converted input character string exceeds the maximum length specified in the COM Transaction Integrator component library and that the specified conversion mapping does not permit truncating the string. Check the application program. If no errors are discovered consider allowing truncation or increasing the allowable length of the converted character string.



CAUSE
Any Microsoft Component Object Model (COM)-aware programming language can access COMTI. Some languages do not work directly with string data and the null terminator must be included specifically as a part of the returned data. The additional defined character allows for the null terminator.



STATUS
This behavior is by design.



MORE INFORMATION
To work around this behavior, use one of these two methods:
 * When you program with languages such as Microsoft Visual Basic, set the maximum length of the string to be the DefinedSize – 1.
 * Change the parameter definition in the COMTI type library to allow the field to be truncated if it is too long. To this on the COBOL tab in the properties of the field. By default, you will receive an error message if the field contains more data than the parameter is defined for. If you set this option, you will not receive any warning messages if any data is truncated.

Additional query words: NewRecordset

Keywords: kbinfo kbbug kbfix KB318558

-

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

© Microsoft Corporation. All rights reserved.