CoInitialize(NULL);
_ConnectionPtr pConn(__uuidof(Connection));
_RecordsetPtr pRst(__uuidof(Recordset));
pConn->ConnectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Documents and Settings\\List.mdb;Persist Security Info=False";
pConn->Open("","","",adConnectUnspecified);
MessageBox("æ°æ®åºè¿æ¥æ£å¸¸!");
pRst=pConn->Execute("select * from DB1",NULL,adCmdText);
while(!pRst->rsEOF)
{
((CListBox *)GetDlgItem(IDC_LIST1))->AddString((_bstr_t)pRst->GetCollect("åå"));
pRst->MoveNext();
}
pRst->Close();
pConn->Close();
pRst.Release();
pConn.Release();
CoUninitialize();
追é®åå¨åªä¸ªæ件ä¸ï¼
追çå¨ä½ ååºæ¥è¯¢æ°æ®åºçäºä»¶çæºæ件ä¸å»åã