PRB: "Invalid Cursor Position" Using UserConnection to GetChunk (170368)
The information in this article applies to:
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q170368 SYMPTOMS
When you use the UserConnection Designer to establish a connection and
retrieve an RDO result set, you will encounter the following error:
"Run-Time error '40002'
S1109:[Microsoft][ODBC SQL Server Driver] Invalid Cursor Position"
if the RDO result set includes a BLOB (Binary Large Object) column and you
do not change any default values.
This error occurs at the GetChunk method.
CAUSE
Due to the ODBC limitation, GetChunk fails when you use a Forward only
cursor with Rowset Size > 1. Using UserConnection Designer, the default
cursor is Forward only, and Rowset Size is 500. This causes "Invalid Cursor
Position" error.
RESOLUTION
To get BLOB data using a Forward-only cursor, you can:
- Set the Rowset Size to 1 on the Advanced tab of UserConnection Queryset
object Properties page.
-and-
- Set Cursor Library to "Use server-side cursors" or "Use None" on the
Miscellaneous tab of UserConnection object Properties page.
You could also open a Keyset type resultset in code by setting the
CursorType property of your RdoQuery object before executing the query,
such as the following:
Dim cn As New UserConnection1
Dim rs as rdoResultset
cn.EstablishConnection 'establish connection
cn.rdoQueries("Query1").CursorType = rdOpenKeyset 'define cursortype
cn.Query1 'execute the query
Set rs = cn.LastQueryResults
REFERENCES
For additional information, please see the following articles in the
Microsoft Knowledge Base:
166281
: HOWTO: Create and Implement a UserConnection
153238
: HOWTO: Use GetChunk and AppendChunk Methods of RDO Object
(c) Microsoft Corporation 1997, All Rights Reserved.
Contributions by Adrian Chiang, Microsoft Corporation
Modification Type: | Minor | Last Reviewed: | 1/8/2003 |
---|
Keywords: | kbprb KB170368 |
---|
|