ADO中怎样得到一个Recordset中的记录数? 有没有一个方法或变量可以得到一个记录集的所有记录数? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 其他的都不安全,建议不要用GetRecordCount函数 还有一个办法是直接用先SQL的select count(*) 得到记录数 if (m_pRecordset->Supports(adApproxPosition) && m_pRecordset->Supports(adBook)){ return m_pRecordset->RecordCount;} 谢谢几位, 我用GetRecordCount()和RecordCount都试过,可是都返回-1, 是不是有什么东西要先处理啊! 在使用m_pRecordset->Open之前加上这句:m_pRecordset->CursorLocation = adUseClient; GetRecordCount之前要用游标设置在客户端也可以用select count(*) try{ pRecordset=pConnection->Execute("select count(*) from C_node;", NULL, adCmdText);}catch(_com_error *e){ WarningMsgBox(e->ErrorMessage()); return false;}n=pRecordset->GetCollect(_variant_t(long(0)));n就是了 C如何接收HTTP Post应答报文 升星星,散分分。。。[9] [讨论]--MFC的CAsyncSocket的效率问题-- 关于多线程问题 如何捕获U盘格式化命令的系统消息? 求救 一个 关于 进程id 和 文件名 的问题 Windows7 CreateFile() 总是错误? ●●●●我用TAPI2.2编程,接听来电的问题!有兴趣的朋友一起讨论一下吧!●●●● Activex控件响应消息问题,如何知道用户向哪个控件发送KeyDown Link error(VC) 请教在Edit Box中如何调整字体的大小 在字符串中加入回车键
{
return m_pRecordset->RecordCount;
}
m_pRecordset->CursorLocation = adUseClient;
也可以用select count(*)
{
pRecordset=pConnection->Execute("select count(*) from C_node;",
NULL,
adCmdText);
}
catch(_com_error *e)
{
WarningMsgBox(e->ErrorMessage());
return false;
}
n=pRecordset->GetCollect(_variant_t(long(0)));n就是了