Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3029

SQLSetPos failure

$
0
0
Hi,
I am trying to do follwing:
Execute a query on the database and grab just some fields results.
Then call SQLSetPos( stmt, 0, SQL_POSITION, SQL_LOCK_NO_CHANGE ); and then process the complete data again.

Unfortunately the call to SQLSetPos() fails with the "Invalid cursor state". Looking at the MSDN, it says:

Quote:

The StatementHandle was in an executed state, but no result set was associated with the StatementHandle.
I am not sure I understand. I am just trying to move the cursor pointer to the first record of the recordset and so yes the statement is in the executed state and the result set should be available from the record 1 again.

Does anybody knows how do I fix it? Or there is a better way?

I was trying to not to re-create the statement handle, since I already have it and I already have a result set.

Just tried to use "1" as a second parameter. Got the same error.


Thank you.

Viewing all articles
Browse latest Browse all 3029

Latest Images

Trending Articles



Latest Images