ATL ( atldbcli.h) CCommand <CManualAccessor, CRowset, CNoMultipleResults>
SELECT COUNT(*) from Table_Name
CCommand <CManualAccessor, CRowset, CNoMultipleResults> atlAccessor; CDBPropSet commandProperties(GlobalSettings::GetDBType () == MSSQL ? DBPROPSET_ROWSET : ORAPROPSET_COMMANDS);//ORAPROPSET_COMMANDS); SetCommandProperties(commandProperties); String newStatement; newStatement.Format (L" SELECT COUNT(*) FROM %s ",(const wchar_t*)m_tableInfo->GetName ()); DBROWCOUNT rowCount; HRESULT hr = atlAccessor.CreateAccessor(nBindEntries, buffer, nBufferSize); if (S_OK == hr ) { DBROWCOUNT rowsAffected; hr = atlAccessor.Open (*session, (LPCWSTR)newStatement, &commandProperties,&rowsAffected,DBGUID_DEFAULT,false); if (S_OK == hr ) { DBCOUNTITEM dbCountItem=0 , dbRowCount =0; BYTE* data = atlAccessor.GetBuffer(); MessageBox(NULL,L"",L"",S_OK); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)