Stuset st;
CString sql,num,name,clss,mth,chn;
DWORD exstyle=m_listctl.GetExtendedStyle();
m_listctl.SetExtendedStyle(exstyle|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|
LVS_EX_CHECKBOXES|WS_EX_STATICEDGE);
CRect rect;
m_listctl.GetClientRect(&rect);
m_listctl.InsertColumn(0,_T("学号"),LVCFMT_LEFT,rect.Width()/5);
m_listctl.InsertColumn(1,_T("姓名"),LVCFMT_LEFT,rect.Width()/5);
m_listctl.InsertColumn(2,_T("班级"),LVCFMT_LEFT,rect.Width()/5);
m_listctl.InsertColumn(3,_T("数学"),LVCFMT_LEFT,rect.Width()/5);
m_listctl.InsertColumn(4,_T("语文"),LVCFMT_LEFT,rect.Width()/5);
sql.Format("select * from Student");
st.Open(CRecordset::dynaset,sql);
num=st.m_Sno;
name=st.m_Sname;
m_listctl.InsertItem(0,num);
m_listctl.SetItemText(0,1,name);
st.MoveNext(); m_listctl.InsertItem(1,num);
m_listctl.SetItemText(1,1,name);
}
st.Close;
我打开一个记录集,然后MOVENEXT(),可当前记录还是没变,怎么回事?
解决方案 »
- MFC 消息响应问题,高手请进!
- 树控件中文件夹和文件的顺序问题
- 求救:哪里有问题啊?
- 求助:error C2872: 'Window' : ambiguous symbol
- 发送图片
- 如何在Dlg上添加一个ComboBoxEx?? Controls上面只有ComboBox
- ***关于VB下写COM+的类初始化的问题*****
- 请大家推荐关于数据库方面的好书!
- 关于关闭指定窗口和得到指定句柄的问题
- 如何获取GPU占用率,注意:是GPU不是CPU
- 请教,有没有办法知道鼠标当前停在哪一个HTML元素上?
- manifest authoring error c1010001: Values of attribute "name" not equal in diff
num=st.m_Sno;
name=st.m_Sname;m_listctl.InsertItem(1,num);