[unixODBC-dev] RE: FreeTDS Digest, Vol 22, Issue 19

Alf C Stockton alf at stockton.co.za
Sat Nov 13 20:42:50 GMT 2004


Gentlemen, Thank you for your help. I, or rather I should say we, for without 
your help I would not have managed, have now got isql to connect and do what 
it is supposed to do.

A little niggle is the following in my code.

>From the following code :-
         printf("Connected !\n");
         V_OD_erg=SQLExecDirect(V_OD_hstmt,
              "SELECT * FROM jackpot_register WHERE message_id = 34",SQL_NTS);
         if ((V_OD_erg != SQL_SUCCESS) && (V_OD_erg != SQL_SUCCESS_WITH_INFO))
                 {
                 printf("Error Select %d\n",V_OD_erg);
                 SQLGetDiagRec(SQL_HANDLE_DBC, V_OD_hdbc,1, V_OD_stat, &V_OD_err,
                                V_OD_msg,100,&V_OD_mlen);
                 printf("%s (%d)\n",V_OD_msg,V_OD_err);
                 SQLFreeHandle(SQL_HANDLE_DBC,V_OD_hdbc);
                 SQLFreeHandle(SQL_HANDLE_STMT,V_OD_hstmt);
                 SQLFreeHandle(SQL_HANDLE_ENV, V_OD_Env);
                 exit(0);
                 }

I am getting the following error:-
About to SQLConnect()
Connected !
Error Select -2
[unixODBC][FreeTDS][SQL Server]Changed language setting to us_english. (5703)

BTW The above SELECT statement works fine in isql.

---

Regards,
Alf Stockton	www.stockton.co.za

It is easier to write an incorrect program than understand a correct
one.



More information about the unixODBC-dev mailing list