我正在使用 Visual C++ 和 OLE DB 驱动程序从 MySQL 中提取数据。从 Visual Studio 2008 升级到 2019 并将 ODBC 驱动程序 5.1 升级到版本 8.0 后,我遇到错误“db s endofrowset:到达行集或章节的开始或结束”的问题。
请看下面的代码。
hr = rsDyTblInfo.Open(m_oSession1); //CSession m_oSession1
if(FAILED(hr))
{
HandleDbError(hr, "GetDetails");
}
else
{
hr = rsDyTblInfo.MoveFirst(); // getting "db s endofrowset"
if(hr == 0)
{
// just add a new entry to the list
bRet = TRUE;
}
rsDyTblInfo.Close();
}