[freetds] dbresults returning no res_info

Kaveri, Ramesh ramesh.kaveri at intel.com
Tue Dec 10 13:44:09 EST 2002


Hi all

I have a linux applications which dumps some data into MSSQL 7.0 through
FreeTDS.  I have a problem with dbresults.  The problem is - dbresults
returns no res_info.  I am supposed to get num_cols as 1, but it returns as
0.  

Here is the piece of code that I have:


	if(*legosQuery)
	 {
	if (dbcmd(dbproc,legosQuery) != SUCCEED) {
            printf("dbcmd failed\n");
            }
   
           if (dbsqlexec(dbproc) != SUCCEED) 
	{
            printf("dbsqlexec failed\n");
     	}
     printf("After dbsqlexec\n");
          
     if (dbresults(dbproc) != FAIL) { 
         TDSRESULTINFO *ResInfo;
         TDSSOCKET *Tds;
         Tds = (TDSSOCKET*)dbproc->tds_socket;
         ResInfo = Tds->res_info;       
         if(ResInfo)
          printf (">numcols: %d \n",ResInfo->num_cols); 
 
In this always ResInfo was false.  The version of MSSQL is 7.0.  I am using
freeTDS 0.53.  I have the following environment variable set:

SYBASE /freeTDS/0.53
TDSVER 70
LD_LIBRARY_PATH

the environement is:
RedHat Linux 7.2 - Kernal 2.2.17-14

Has anybody experienced similar problem. Any suggesion / tips / solutions
are welcome

Thanks in advance

Ramesh Kaveri



More information about the FreeTDS mailing list