数据库访问,无效的描述符索引
bool CNewform::ReadToTable(void)
{
while (!m_CargoSet.IsEOF())
{
m_CargoSet.MoveNext();
}
int nCount= m_CargoSet.GetRecordCount();
m_CargoSet.MoveFirst();
CString strValue;
int nFiledCount= m_CargoSet.GetODBCFieldCount();
for (int i =0;i<nCount;i++)
{
m_CargoView.InsertItem(i,0);
for (int j=0;j<nFiledCount;j++)
{
m_CargoSet.GetFieldValue(j,strValue);
m_CargoView.SetItemText(i,j,strValue);
}
m_CargoSet.MoveNext();
}
return false;
}
bool CNewform::ReadToTable(void)
{
CString strValue;
int nFiledCount= m_CargoSet.GetODBCFieldCount();
int i=0;
while (!m_CargoSet.IsEOF())
{
m_CargoView.InsertItem(i,0);
for (int j=0;j<nFiledCount;j++)
{
m_CargoSet.GetFieldValue(j,strValue);
m_CargoView.SetItemText(i,j,strValue);
}
i++;
m_CargoSet.MoveNext();
}
return false;
}