Subject Cursor unknown Error
Author Alan McDonald
OK - I may have finally landed on something here. I ask for patience once
again while revisiting this subject.

I have finally found a reproducible case for this Cursor unknown Error.

I have an SSP in an IB_Query. Keylinks undefined, AutoDefined unchecked as
recommended by JW.
The dataset returned is bigger than the default buffer size and by default I
have AutoFetchAll set to False.

Now I finally noticed that when I call Transaction.Refresh(true) while this
dataset is first opened, I get no visible error but if I monitor the call I
get these lines
/*---
CLOSE CURSOR
STMT_HANDLE = 26790052

ERRCODE = 335544569
----*/

in the monitor but no exception is raised to the application.

This error code is a dynamic SQL error. So it must be that IBO is swallowing
this exception. Is this correct? and Why?

Next, I page down in the grid once - I assume that I am now toward the
bottom of the buffer. I can tell this because the grid scroll bar goes to
the bottom and does not show the true position of the cursor within the
expected dataset (I'm used to this behaviour). I call the
Transaction.Refresh(true) method again. I get the following:
/*---
INTERPRETE BUFFER =

ERRCODE = 17
----*/
/*---
INTERPRETE BUFFER = Dynamic SQL Error

ERRCODE = 21
----*/
/*---
INTERPRETE BUFFER = SQL error code = -504

ERRCODE = 14
----*/
/*---
INTERPRETE BUFFER = Cursor unknown

ERRCODE = -1
----*/
followed by the error code stuff above and then the application exception
I'm used to getting. If I set the query to AutoFetchALL, these errors do not
surface nor does the exception.

I've tried to do a quick demo of this setup with the employee database. An
SSP which returns fields of the employee table.
If I set AutoFetchAll to False I get the silent ERRCODE = 335544569 and if I
set the AutoFetchAll to true, even this error is not reported in the
monitor.
I can't, as yet, get my demo to hit the full blown cursor unknown error
yet - I think it's because I can't fill the buffer completely but I'm still
trying.

Any comments?
Alan