[freetds] Invalid cursor state

Swapnil Shinde swapnil34 at gmail.com
Thu Mar 11 12:27:30 EST 2010

I am stuck at a step and will appreciate your suggestion.

I am using a combination of Snort+unixODBC+freeTDS+mssql. Everything is
working fine except freeTDS is giving me following error for every query
after the first query made by the Snort.

*DIAG [24000] [FreeTDS][SQL Server]Invalid cursor state *

{This line is taken from unixODBC trace}

After doing some research; I have found that in order to do multiple queries
at faster rate; one needs to enable MARS (Multiple Active Result Sets)
parameter in the connection API of mssql. If it is not done in this fashion;
then one may get the above error.

Now, can you tell me if I am on the right track and when would you guys be
able to come up with this correction? Also, you can let me know the code
where connection APIs are used and I can make changes if you want. (I can do
these changes; I have already made minor changes in Snort code in order to
make this combination work). Any direction over this problem would be

Thanks in advance.

More information about the FreeTDS mailing list