代码如下:
try
{
m_pRecordset->MoveFirst();
m_list.InsertItem(0,(LPCTSTR)"");
m_list.SetItemText(0,0,(LPCTSTR)(_bstr_t)m_pRecordset->GetCollect("name"));
m_list.SetItemText(0,1,(LPCTSTR)(_bstr_t)m_pRecordset->GetCollect("sex"));
m_list.SetItemText(0,2,(LPCTSTR)(_bstr_t)m_pRecordset->GetCollect("grade"));
m_list.SetItemText(0,3,(LPCTSTR)(_bstr_t)m_pRecordset->GetCollect("class"));
m_pRecordset->MoveNext();
}
catch(_com_error &e)
{
AfxMessageBox(e.Description());
return TRUE;
}
若程序为m_pRecordset->GetCollect("名字")无法获取到记录集,只能接受英文或者数字的字段名,猜想可能是MySQL对中文兼容不好,仍需解决。
最后
以上就是彩色音响最近收集整理的关于MySQL数据库获取记录集失败问题的全部内容,更多相关MySQL数据库获取记录集失败问题内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复