The information in this article applies to:
SYMPTOMSThe DAO SDK defines a function called GetRowsEx that is a method of the DAO recordset object. This function fails to handle null field values correctly for variable-length fields. If a null value exists in a field that is fetched with GetRowsEx(), the buffer doesn't get updated. For example, you may find that the buffer contains the same value from the previous GetRowsEx() call if you specified dbBindSTRING in the DAORSETBINDING struct. Or, if you specified dbBindLPSTRING in the DAORSETBINDING struct, you may find that the pointer points to incorrect data. CAUSEThis a bug with the GetRowsEx() function. RESOLUTIONClear the buffer before calling the GetRowsEx() method. If a null value is encountered, the buffer will remain unchanged for the field. Check the buffer for whether the value has been modified after the GetRowsEx call. If it hasn't changed, the value is null. See the code below for an example of how to handle null values. STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATIONThe following sample code demonstrates how to change the DoGetRowsEx() function in the GETROWS DAO SDK sample so that it handles null values. This function is very similar to the old one except the fetching size has been changed to two records at a time, and the buffer where GetRowsEx() stores the data is cleared before each call. Also, a check is performed to see if the data is null and, if it is, the function places the text "null" in the output string. Sample Code
Additional query words: kbVC400bug 4.00 4.10 4.20
Keywords : kbDAO |
Last Reviewed: July 28, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |