trVal = ::SysAllocString( L"DSN=AdoDemo;UID=sa;PWD=;" );
hr = CoCreateInstance( CLSID_CADORecordset,
NULL,
CLSCTX_INPROC_SERVER,
IID_IADORecordset,
(LPVOID *) &Rs1 );
if( SUCCEEDED( hr ) ) hr = Rs1->Open( Source,
Connect,
adOpenForwardOnly,
adLockReadOnly,
-1 );
file://这里你可以对记录集Rs1进行处理
if( SUCCEEDED( hr ) ) hr = Rs1->Close();
if( SUCCEEDED( hr ) ) { Rs1->Release(); Rs1 = NULL; }
if( SUCCEEDED( hr ) ) ::MessageBox( NULL, "Success!", "", MB_OK );
}