本文整理汇总了C++中_RecordsetPtr::GetRecordCount方法的典型用法代码示例。如果您正苦于以下问题:C++ _RecordsetPtr::GetRecordCount方法的具体用法?C++ _RecordsetPtr::GetRecordCount怎么用?C++ _RecordsetPtr::GetRecordCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_RecordsetPtr
的用法示例。
在下文中一共展示了_RecordsetPtr::GetRecordCount方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReplaceAreaValue
//替换指定范围的某字段的值.
bool CFoxBase::ReplaceAreaValue(_RecordsetPtr pRs, CString strField, CString strValue, int startRow, int endRow)
{
if(startRow > endRow)
{
endRow = startRow;
}
if( endRow <= 0 )
{
return false;
}
if( endRow > pRs->GetRecordCount() )
{
return false;
}
if( pRs->GetRecordCount() <= 0 )
{
return false;
}
pRs->MoveFirst();
for(int i=1; i<=endRow && !pRs->adoEOF; i++, pRs->MoveNext())
{
if( i >= startRow )
{
pRs->PutCollect(_variant_t(strField), _variant_t(strValue));
pRs->Update();
}
}
return true;
}
示例2: switch
void CDlg::InitDataGrid1(CDatagrid1& Grd,_RecordsetPtr& rs)
{
CColumns GrdClms;
CString strCap,strRec;
CString s;
long num,numRec;
short i;
float wdth;
strCap.LoadString(IDS_STRING9013);
numRec = 0;
GrdClms.AttachDispatch(Grd.get_Columns());
if(rs->State==adStateOpen) {
num = rs->GetadoFields()->GetCount();
numRec = rs->GetRecordCount();
strRec.Format(_T(" %i"),numRec);
strCap +=strRec;
Grd.put_Caption(strCap);
for (i=0; i<num; i++) {
switch(i) {
case 0:
GrdClms.GetItem((COleVariant) i).SetVisible(FALSE);
break;
case 1:
wdth = 75;
GrdClms.GetItem((COleVariant) i).SetWidth(wdth);
break;
case 2:
wdth = 190;
GrdClms.GetItem((COleVariant) i).SetWidth(wdth);
break;
case 3:
wdth = 48;
GrdClms.GetItem((COleVariant) i).SetWidth(wdth);
break;
case 4:
wdth = 185;
GrdClms.GetItem((COleVariant) i).SetWidth(wdth);
break;
case 5:
wdth = 100;
GrdClms.GetItem((COleVariant) i).SetWidth(wdth);
break;
default:
GrdClms.GetItem((COleVariant) i).SetVisible(FALSE);
break;
}
}
}
else {
strRec.Format(_T(" %i"),numRec);
strCap +=strRec;
Grd.put_Caption(strCap);
}
}
示例3: ImportHangerRestraints
//吊架和支架数据的导入pfg20050615
//flag=0 为吊架; flag=1 为支架
//记录集是结果集 对应ZA表
//rsHR记录集是数据源集(弹簧、吊架)
//ltemp 支吊架号
void CAESARIIToPHS::ImportHangerRestraints(_RecordsetPtr rsData,_RecordsetPtr rsHR,long <emp,long &FileNameID,char *strPSAVER,long &node,int flag)
{
_variant_t tmpvar;
long lTmp;
try
{
if(flag)
{
tmpvar=rsHR->GetCollect(_T("node_num"));
lTmp=vtoi(rsHR->GetCollect(_T("RES_TYPEID")));//pfg20050624
}
else
{
tmpvar=rsHR->GetCollect(_T("node"));
}
if(tmpvar.vt==VT_EMPTY||tmpvar.vt==VT_NULL)
{
return;
}
else
{
node=vtoi(tmpvar);
}
if ( node < 1e-6 ) //5.2版本中所有的约束信息会导入INPUT_RESTRAINTS表中(同一约束点会有四条记录,所以会有NODE_NUM为-1情况)
return;
if(rsData->GetRecordCount()>0)
{
rsData->MoveFirst();
}
rsData->Filter = _variant_t(CString("[jsdbh1] = ") + ltos(node)+" AND [FileNameID]="+ltos(FileNameID));
if (rsData->adoEOF&&rsData->BOF)
{
rsData->AddNew();
rsData->PutCollect("VolumeID",_variant_t(EDIBgbl::SelVlmID));
rsData->PutCollect("zdjh",_variant_t((long)(ltemp+1)));
rsData->PutCollect("FileNameID",_variant_t(FileNameID));
ltemp++;
rsData->Update();
}
rsData->PutCollect("PSAver", _variant_t(strPSAVER));
rsData->PutCollect("UPxyz",_variant_t((long)m_iUPxyz));
rsData->PutCollect("JSDBH1", _variant_t((long)node));
rsData->Update();
}
catch (_com_error &e)
{
CString strMsg;
strMsg.Format("%s:%d %s", __FILE__, __LINE__, (LPSTR)e.Description());
AfxMessageBox(strMsg);
}
}
示例4: switch
__int64
ADOConnection::_GetIdentityFromRS(_RecordsetPtr pRS) const
{
try
{
if (pRS->GetRecordCount() == 0)
return 0;
_variant_t vaField;
FieldsPtr pFields;
FieldPtr pField;
HRESULT hr;
hr = pRS->get_Fields( &pFields );
vaField = "IDENT";
pFields->get_Item( vaField, &pField );
vaField.Clear();
if (pField)
{
pField->get_Value(&vaField);
switch (vaField.vt)
{
case VT_NULL:
return 0;
case VT_I4:
return vaField.intVal;
default:
if (vaField.decVal.sign == DECIMAL_NEG)
return -vaField.cyVal.int64;
else
return vaField.cyVal.int64;
}
}
return 0;
}
catch (...)
{
ErrorManager::Instance()->ReportError(ErrorManager::High, 5030, "ADOConnection::_GetIdentityFromRS", "Error while determening @@IDENTITY");
}
return 0;
}
示例5: GetRecordCount
DWORD CADODatabase::GetRecordCount(_RecordsetPtr m_pRs)
{
DWORD numRows = 0;
numRows = m_pRs->GetRecordCount();
if(numRows == -1)
{
if(m_pRs->EndOfFile != VARIANT_TRUE)
m_pRs->MoveFirst();
while(m_pRs->EndOfFile != VARIANT_TRUE)
{
numRows++;
m_pRs->MoveNext();
}
if(numRows > 0)
m_pRs->MoveFirst();
}
return numRows;
}