[摘要](rc == SQL_SUCCESS_WITH_INFO)) m_bOpen = TRUE ; TRACE0("Open database Succeed !\n"...
(rc == SQL_SUCCESS_WITH_INFO))
{
m_bOpen = TRUE ;
TRACE0("Open database Succeed !\n") ;
return TRUE ;
}
else
{
m_bOpen = FALSE ;
TRACE0("Open Database Failed !\n") ;
return FALSE ;
}
}
void CWdcDatabase::Close()
{
if(m_bOpen)
{
if(hstmt_select)
{
SQLFreeStmt(hstmt_select,SQL_DROP) ;
hstmt_select = NULL ;
}
SQLDisconnect(hdbc) ; /*Dis hdbc*/
SQLFreeConnect(hdbc) ; /*Free Odbc*/
SQLFreeEnv(henv) ; /*Free henv*/
m_bOpen = false;
TRACE0("Close database Succeed !\n") ;
}
}
BOOL CWdcDatabase::Execute(const CString &sSQL)
{
RETCODE rc ;
unsigned char szSQLSTATE[6] ;
SDWORD nErr ;
unsigned char msg[MAX_ERROR_MSG + 1] ;
SWORD cbmsg ;
m_sErrMsg = "" ;
m_sQuery = sSQL ;
if(!m_bOpen)
return FALSE ;
SQLAllocStmt(hdbc,&hstmt) ;
memset((char*)szQuery,0x00,sizeof(szQuery)) ;
strcpy((char*)szQuery,m_sQuery) ;
rc = SQLExecDirect(hstmt,
szQuery,
SQL_NTS) ;
m_nError = (int) rc ;
if(rc == SQL_SUCCESS (北联网教程,专业提供视频软件下载)
……