_RecordsetPtr rcsTableSet =NULL;
_bstr_t bsTable;
_bstr_t bsCmdLine = TEXT("select * from table_name where table_date > to_date('32/03/2012', 'MM/DD/YY')");
TESTHR(rcsTableSet.CreateInstance(__uuidof(Recordset)));
try
{ rcsTableSet->Open(bsCmdLine,szReq,adOpenForwardOnly, adLockReadOnly, adCmdText);
rcsTableSet->MoveFirst();
while (!rcsTableSet->EndOfFile)
{
// тут выгребаем строчки из рекордсетаSendMessage
bsTable = rcsTableSet->Fields->GetItem("Some_field")->Value.bstrVal;
(hCombo,CB_ADDSTRING,0,(long)(char *)bsTable);
rcsTableSet->MoveNext();
}
SendMessage(hCombo,CB_SETCURSEL,-1,0);
rcsTableSet->Close();
}catch(_com_error &e)
{ char Msg[256];
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
sprintf(Msg,"Source : %s \n Description : %s \n",(LPCSTR)bstrSource,(LPCSTR)bstrDescription);
MessageBox(NULL,Msg,"Exeption occured",MB_OK | MB_APPLMODAL);
return 1;
}
// тут выгребаем строчки из рекордсета
bsTable = rcsTableSet->Fields->GetItem("Some_field")->Value.bstrVal;
SendMessage(hCombo,CB_ADDSTRING,0,(long)(char *)bsTable);
rcsTableSet->MoveNext();
ListBox1->Clear();
ADOQuery1->First();
for(i=0;i<ADOQuery1->RecordCount;i++)
{
ListBox1->Items->Add(ADOQuery1->FieldByName("Улица")->AsString);
ADOQuery1->Next();
}
Если Вы уже зарегистрированы на Портале - войдите в систему, если Вы еще не регистрировались - пройдите простую процедуру регистрации.