盘绰网教程:是一个免费提供流行视频软件教程、在线学习分享的学习平台!

一个用技巧强大的ODBC API 函数访问数据库类

时间:2024/3/22作者:未知来源:盘绰网教程人气:


[摘要]rc == SQL_SUCCESS_WITH_INFO) /*有数据*/ SQLFreeStmt(hstmt_select,SQL_DROP) ; hstmt_select = ...
rc == SQL_SUCCESS_WITH_INFO)
    { /*有数据*/
    SQLFreeStmt(hstmt_select,SQL_DROP) ;
    hstmt_select = NULL ;
          return lRet ;
    }
    else if (rc == 100)
    { /*没有数据*/
    SQLFreeStmt(hstmt_select,SQL_DROP) ;
    hstmt_select = NULL ;
          return 0 ;
    }
       else if (rc < 0)
    { /*出错*/
         goto end ;
    }
   }
   else
   { /* SQLExecDirect FALSE */
    goto end ;
  }

end:
  {
      m_sErrMsg = "" ;
         while(SQLError(0,
              0,
        hstmt_select,
                       szSQLSTATE,
        &nErr,
        ErrMsg,
        sizeof(ErrMsg),
        &cbmsg)==SQL_SUCCESS)
         m_sErrMsg += "\t\t" + CString(ErrMsg) +"\n" ;  

   SQLFreeStmt(hstmt_select,SQL_DROP) ;
   hstmt_select = NULL ;
    return -1 ;
  }
}
/*非常有用函数,用在确保语句句柄释放*/
void CWdcDatabase::DropHstmtSelect()
{
if(hstmt_select !=NULL)
{
  SQLFreeStmt(hstmt_select,SQL_DROP) ;
  hstmt_select = NULL ;
}
}

关键词:  一个用技巧强大的ODBC  API  函数访问数据库类





Copyright © 2012-2018 盘绰网教程(http://www.panchuo.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版