Snort.org home  
Got Source? About Snort About Sourcefire Snort FAQ
Sourcefire Network Security - the creators of Snort

Snort Forums Archive

Archive Home » Snort.org Discussion » Error unixODBC+FreeTDS+MSSQL

Please note that the categories listed below represent an archived version of our forums pages. To view the current version and be able to post and reply to threads, please register and login here to go to the full forums pages.

[ Notice: Full Version of This Topic ]

Error unixODBC+FreeTDS+MSSQL


Posted by sugar2 on March 26, 2007 14:56:37

Hi, I have a off topic question in about unixODBC+FreeTDS+MSSQL, days ago it was working well but now, the FreeTDS is ouputting an error when I query...
This the php code. Tested and it use to work, now is giving this error: "Error rs_RMS1:[unixODBC][FreeTDS][SQL Server]Invalid cursor state":
[code]
function query_to_rms1_qty($rms2_Qdesc3) // rms = calexico RMS
{
include "/usr/local/www/data/scripts/db_stuff/db_secrets.php";
$conn=odbc_connect($pos_host,$pos_user,$pos_pass);
if (!$conn) {return "Error conn:".odbc_errormsg(); }

$queryRMSqty1 = "SELECT Quantity FROM Custom_Piso_Qty WHERE SubDescription3 = '".$rms2_Qdesc3."'";
if (!$queryRMSqty1) {return "Error queryRMSqty1:".odbc_errormsg(); }

$rs_RMS1=odbc_exec($conn,$queryRMSqty1);
if (!$rs_RMS1) {return "Error rs_RMS1:".odbc_errormsg(); }

$RMS_qty1=odbc_result($rs_RMS1,'Quantity');
if (!$RMS_qty1) {return "Error RMS_qty1:".odbc_errormsg(); }

return $RMS_qty1;
odbc_free_result($rs_RMS1);
odbc_close($conn);
}
[/code]

I went to my FreeBSD console and testing, this were the results:
[code]
$ isql pos-server *** *****
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>SELECT Quantity FROM Custom_Piso_Qty WHERE SubDescription3 = '20005-FRD'
[ISQL]ERROR: Could not SQLPrepare
[/code]

how can I handle this issue?
thanks in advance

Aldo