rc == SQL_SUCCESS_WITH_INFO)
m_sFieldValue[f] = (CString) szData ;
else
m_sFieldValue[f] = "" ;
}
else
m_sFieldValue[f] = "" ;
}
return TRUE ;
}
m_sErrMsg = "" ;
while(SQLError(0,
0,
hstmt_select,
szSQLSTATE,
&nErr,
msg,
sizeof(msg),
&cbmsg )==SQL_SUCCESS )
m_sErrMsg += "\t\t" +CString (msg) + "\n" ;
SQLFreeStmt(hstmt_select,SQL_DROP) ;
hstmt_select = NULL ;
return FALSE ;
}
/*统计符合条件的纪录总数
返回值
-1: 执行出错
>0: 执行成功,并且返回统计结果 */
long CWdcDatabase::GetRecordCount(CString &sSel)
{
unsigned char szSQLSTATE[6] ;
SDWORD nErr ;
unsigned char ErrMsg[500] ;
SWORD cbmsg;
long lRet ; /*返回值*/
unsigned char lpSelect[1000];
memset((char*)lpSelect,0x00,sizeof(lpSelect)) ;
if(sSel=="")
sTemp.Format("Select count(*) from %s ",m_sTable) ;
else
sTemp.Format("Select Count(*) From %s Where %s",m_sTable,sSel) ;
if(!m_bOpen)
return -1 ;
strcpy((char*)lpSelect,sTemp) ;
SQLAllocStmt(hdbc,&hstmt_select) ;
rc=SQLExecDirect(hstmt_select,
lpSelect,
SQL_NTS) ;
if(rc==SQL_SUCCESS (北联网教程,专业提供视频软件下载)
……