2. For example, connect to SQL:
//? Open the database
strDBClass。 Format(_T("Provider=Microsoft。 Jet. OLEDB.4.0 data? Source =% s;; Jeter? OLEDB: database? Password =%s "), m _ strUnEntryptMdbFilePath,m _ strmdb password);
//? Create a connection
HRESULT? hr? =? M _ connection. create instance(_ uuidof(Connection));
_ConnectionPtr? M _ connection-> Open(m_strDBClass,_T(" ",_T(" ",adconnect unspecified);
//? Declare form pointer
_RecordsetPtr? pBandRecordset
pBandRecordset。 create instance(_ _ uuidof(Recordset));
//? execute statement
CString? strSQL(L"SELECT? *? From where? [Band] ";
M _ connection-> Execute((LPCTSTR)strSQL,NULL,0);
//? Select a project? For example, BandInfo
int? iBandInfo? =? Wcscmp (column, l "bandinfo");
And (! recordsetPtr-& gt; adoEOF)
{
var? =? recordsetPtr-& gt; get collect(colum);
if(var.vt? ! =? VT_NULL)
strName? =? (LPCSTR)_ bstr _ t(var);
recordsetPtr-& gt; MoveNext();
}