fr studio 4.8 ADOQuery problem in vc2010

edited December 2010 in FastReport Studio
hi
i find an big problem in vc2010,
my code
IfrxReportPtr pReport(__uuidof(TfrxReport));
IfrxADODatabasePtr pDB(__uuidof(TfrxADODatabase));
IfrxADOQueryPtr pQR(__uuidof(TfrxADOQuery));

pDB->ConnectionString = _bstr_t(L"Provider=SQLOLEDB.1;Password=XXX;Persist Security Info=True;User ID=XXX;Initial Catalog=XXXXX;Data Source=XXX.XXX.XX.XXX;");
pDB->LoginPrompt = false;
pDB->Connected = true;

pQR->Database = pDB;
pQR->Name = _bstr_t(L"XXX");
pQR->Query = _bstr_t(L"SELECT * FROM XXX");

if (pReport->LoadReportFromFile(bstrReportFile) != S_OK)
{
return FALSE;
}

pReport->SelectDataset(true, IfrxDataSetPtr(pQR));
pReport->EngineOptions->ConvertNulls = false;

pReport->PrepareReport(true);
pReport->ShowReport();
pDB->Connected = false;

......


in this pQR->Query = _bstr_t(L"SELECT * FROM XXX"); i find a exception exception "0x7c812afb : 0x0EEDFADE: 0xeedfade"
after this , output a error can't find odbc database source
when i use DesignReport to see , can't find any fields in table
error in 1.jpg
fastreport3.dll version 4.8.203.0

Comments

  • edited 11:00PM
    please use my code try again.

    my code
    ***************************************************************************************
    IfrxReportPtr pReport(__uuidof(TfrxReport));
    IfrxADODatabasePtr pDB(__uuidof(TfrxADODatabase));
    IfrxADOQueryPtr pQR(__uuidof(TfrxADOQuery));

    pDB->ConnectionString = _bstr_t(L"Provider=SQLOLEDB.1;Password=XXX;Persist Security Info=True;User ID=XXX;Initial Catalog=XXXXX;Data Source=XXX.XXX.XX.XXX;");
    pDB->LoginPrompt = false;
    pDB->Connected = true;

    pQR->Database = pDB;
    pQR->Name = _bstr_t(L"XXX");
    pQR->Query = _bstr_t(L"SELECT * FROM XXX");
    pReport->SelectDataset(true, IfrxDataSetPtr(pQR));

    if (pReport->LoadReportFromFile(bstrReportFile) != S_OK)
    {
    return FALSE;
    }

    pReport->EngineOptions->ConvertNulls = false;

    pReport->PrepareReport(true);
    pReport->ShowReport();
    pDB->Connected = false;
    **********************************************************************************************
  • edited 11:00PM
    It doesn't work. Sorry. I tried replicating this.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.