运行时 弹出 试图越过数据的存储空间
代码段
DWORD dwStyle = ::GetWindowLong(m_list.m_hWnd,GWL_STYLE);
SetWindowLong(m_list.m_hWnd, GWL_STYLE, dwStyle | LVS_REPORT);
DWORD ExStyle = m_list.GetExtendedStyle();
m_list.SetExtendedStyle(ExStyle | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
m_list.InsertColumn(0,"编号", LVCFMT_CENTER,50,0);
m_list.InsertColumn(1,"学号",LVCFMT_CENTER,100,0);
m_list.InsertColumn(2,"姓名",LVCFMT_CENTER,100,0);
m_list.InsertColumn(3,"民族",LVCFMT_CENTER,100,0);
m_list.InsertColumn(4,"出生日期",LVCFMT_CENTER,100,0);
m_list.InsertColumn(5,"住址",LVCFMT_CENTER,100,0);
m_list.InsertColumn(6,"身份证号",LVCFMT_CENTER,100,0);
m_list.InsertColumn(7,"联系电话",LVCFMT_CENTER,100,0);
m_list.InsertColumn(8,"政治面貌",LVCFMT_CENTER,100,0);
CXinXiSet m_Set;
m_Set.Open();
while(!m_Set.IsEOF())
{
m_Set.MoveNext();
m_Set.GetRecordCount();
}
m_Set.MoveFirst();
while(!m_Set.IsEOF())
{
for(int num = 0;num < 9; num++)
{
m_list.InsertItem(num,m_Set.m_column1);
m_list.SetItemText(num,1,m_Set.m_stunumber3);
m_list.SetItemText(num,2,m_Set.m_name3);
m_list.SetItemText(num,3,m_Set.m_nation3);
m_list.SetItemText(num,4,m_Set.m_birthday3);
m_list.SetItemText(num,5,m_Set.m_address3);
m_list.SetItemText(num,6,m_Set.m_id3);
m_list.SetItemText(num,7,m_Set.m_callnumber3);
m_list.SetItemText(num,8,m_Set.m_plitice3);
m_Set.MoveNext();
}
UpdateData(FALSE);
}
m_Set.MoveFirst();
请高手指点 数据库非空
代码段
DWORD dwStyle = ::GetWindowLong(m_list.m_hWnd,GWL_STYLE);
SetWindowLong(m_list.m_hWnd, GWL_STYLE, dwStyle | LVS_REPORT);
DWORD ExStyle = m_list.GetExtendedStyle();
m_list.SetExtendedStyle(ExStyle | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
m_list.InsertColumn(0,"编号", LVCFMT_CENTER,50,0);
m_list.InsertColumn(1,"学号",LVCFMT_CENTER,100,0);
m_list.InsertColumn(2,"姓名",LVCFMT_CENTER,100,0);
m_list.InsertColumn(3,"民族",LVCFMT_CENTER,100,0);
m_list.InsertColumn(4,"出生日期",LVCFMT_CENTER,100,0);
m_list.InsertColumn(5,"住址",LVCFMT_CENTER,100,0);
m_list.InsertColumn(6,"身份证号",LVCFMT_CENTER,100,0);
m_list.InsertColumn(7,"联系电话",LVCFMT_CENTER,100,0);
m_list.InsertColumn(8,"政治面貌",LVCFMT_CENTER,100,0);
CXinXiSet m_Set;
m_Set.Open();
while(!m_Set.IsEOF())
{
m_Set.MoveNext();
m_Set.GetRecordCount();
}
m_Set.MoveFirst();
while(!m_Set.IsEOF())
{
for(int num = 0;num < 9; num++)
{
m_list.InsertItem(num,m_Set.m_column1);
m_list.SetItemText(num,1,m_Set.m_stunumber3);
m_list.SetItemText(num,2,m_Set.m_name3);
m_list.SetItemText(num,3,m_Set.m_nation3);
m_list.SetItemText(num,4,m_Set.m_birthday3);
m_list.SetItemText(num,5,m_Set.m_address3);
m_list.SetItemText(num,6,m_Set.m_id3);
m_list.SetItemText(num,7,m_Set.m_callnumber3);
m_list.SetItemText(num,8,m_Set.m_plitice3);
m_Set.MoveNext();
}
UpdateData(FALSE);
}
m_Set.MoveFirst();
请高手指点 数据库非空