A simple CRecordView demo.
2025-12-20
Written by: xiaobin










Note: The ODBC driver in Windows 10 21H2 can no longer connect to SQL Server 2000.



After positioning the recordset, display the data for the current row:
void CMFCApplication1View::ShowRow()
{
int nItem;
CString tmp;
tmp.Format(_T("%d"), m_pSet->m_qty);
m_ListCtrl.DeleteAllItems();
nItem = m_ListCtrl.InsertItem(0, CString(m_pSet->m_stor_id));
m_ListCtrl.SetItemText(nItem, 1, CString(m_pSet->m_ord_num));
m_ListCtrl.SetItemText(nItem, 2, m_pSet->m_ord_date.Format("%Y-%m-%d"));
m_ListCtrl.SetItemText(nItem, 3, tmp);
m_ListCtrl.SetItemText(nItem, 4, CString(m_pSet->m_payterms));
m_ListCtrl.SetItemText(nItem, 5, CString(m_pSet->m_title_id));
}