PRB: GetChunk Ignores Offset if Memo Field Is Included in GROUP BY (250640)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q250640 SYMPTOMS
The Offset argument of the GetChunk method is used to set the number of bytes to skip before copying begins within a Memo or Long Binary Field.
However, when the Memo field is included in the GROUP BY clause of the recordset's SELECT statement, the Offset argument is being ignored. This causes the characters from the beginning of the field to be retrieved instead of the characters beginning at the Offset position. For example, if the Memo field contains 500 characters and the Offset and Numbytes arguments are set to 250, GetChunk returns the first 250 characters instead of the last 250 characters as would be expected.
RESOLUTION
Rewrite the query to eliminate all Memo fields from the GROUP BY clause. This can be done by using an aggregate function on the Memo fields, such as the FIRST function. This allows the Memo fields to be removed from the GROUP BY clause. This workaround is illustrated in the example code below.
REFERENCESFor additional information on how to use GetChunk, click the article number below
to view the article in the Microsoft Knowledge Base:
210486 ACC2000: Reading, Storing, and Writing Binary Large Objects
Modification Type: | Major | Last Reviewed: | 5/8/2003 |
---|
Keywords: | kbBug kbJET kbprb KB250640 |
---|
|