On Thu, Jan 05, 2012 at 07:12:48PM +0530, BALAKRISHNAN RAJKUMAR wrote:
> Hi All,
>
>
> I am obtaining two handles from a connection and trying two execute
> two queries on successive lines. While the first execute statement
> succeeds, the second one reports this "invalid cursor state" error. Can we
> use more thane one statement using the same connection in FreeTDS. Could
> some one please clarify.
Please see http://www.freetds.org/faq.html#pending.
The message is an example of the disadvantage of mediation. DB-Library was
designed for TDS, and produces message 20019: "Attempt to initiate a
new Adaptive Server operation with results pending". ODBC has no
protocol-specific error message, even though it has protocol-specific,
implementation-defined *behavior*. Unable to say anything specific, it says
Invalid cursor state
which means,
http://msdn.microsoft.com/en-us/library/windows/desktop/ms713584%28v=vs.85%29.aspx
"A cursor was positioned on the StatementHandle by SQLFetch or
SQLFetchScroll. This error is returned by the Driver Manager if SQLFetch or
SQLFetchScroll has not returned SQL_NO_DATA, and is returned by the driver if
SQLFetch or SQLFetchScroll has returned SQL_NO_DATA."
In simpler words, you cannot call SQLExecute until SQLFetch returns SQL_NO_DATA.
HTH.
--jkl
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.