求助:用ADO连接数据库如何把库中的数据显示在对话框的控件中
CoInitialize(NULL);
_ConnectionPtr pConn(__uuidof(Connection));
_RecordsetPtr pRst(__uuidof(Recordset));
pConn->ConnectionString="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=py;Initial Catalog=StudentDB";
pConn->Open("","","",-1);
pRst=pConn->Execute("select * from student",NULL,adCmdText);
// while(!pRst->rsEOF)
//{
((CListBox*)GetDlgItem(IDC_LIST1))->AddString(
(_bstr_t)pRst->GetCollect("StudentNo"));
m_StudentNo==(_bstr_t)pRst->GetCollect("StudentNo");
pRst->Close();
pConn->Close();
pRst.Release();
pConn.Release();
CoUninitialize();
m_StudentNo为控件的数据成员 ,为什么在对话框中列表控件能显示,而编辑控件不能显示数据?