BUG: GetRowsEx() Incorrectly Handles Null Field Values (153216)
The information in this article applies to:
- The DAO SDK, when used with:
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Editions 4.1
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Professional Edition 4.2
This article was previously published under Q153216 SYMPTOMS
The 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.
CAUSE
This a bug with the GetRowsEx() function.
RESOLUTION
Clear 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.
STATUS
Microsoft 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.
Modification Type: | Major | Last Reviewed: | 12/2/2003 |
---|
Keywords: | KB153216 |
---|
|