Runtime Errorthis application requested the Runtime to terminate it in an unusual way 
Please contact the Application's support team for more information是什么错误,又应该怎么解决呢?

解决方案 »

  1.   

    代码是这样的
    void MainDlg::OnOK() 
    {
    // TODO: Add extra validation here
    UpdateData();
    if(m_ZuCheng.IsEmpty())
    {
    AfxMessageBox("请输入");
    }
    else
    {

    try
    {
             m_pRecordset->Open("select * from YaoFan",
                                         theApp.m_pConnection.GetInterfacePtr(),
                                         adOpenDynamic,
                                         adLockOptimistic,
                                         adCmdText);
                      m_pRecordset->Close();
    m_pRecordset = NULL;
    }
    catch(_com_error *e)
    {
    AfxMessageBox(e->ErrorMessage());
    }
    }
    CDialog::OnOK();
    }我把m_pRecordset->Open("select * from YaoFan",
                                         theApp.m_pConnection.GetInterfacePtr(),
                                         adOpenDynamic,
                                         adLockOptimistic,
                                         adCmdText);
                      m_pRecordset->Close();
    m_pRecordset = NULL;
     去掉就不会有错误
    能告诉我为什么吗?
      

  2.   

    我遇见过,当时是因为数据源没配置,
    在控制面板--管理工具--ODBC数据源里面配
      

  3.   

    可是我已经配置了数据源了啊 就用下面的代码配的,我是个VC菜鸟,原本不用VC的,但是毕业设计用这个做,所以没办法,请高手救命啊!
    AfxOleInit();
    m_pConnection.CreateInstance(__uuidof(Connection));
    try                 
    {
    // 打开本地Access库Yao.mdb
    m_pConnection->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Yao.mdb","","",adModeUnknown);
    }
    catch(_com_error e)
    {
    AfxMessageBox("数据库连接失败,确认数据库Yao.mdb是否在当前路径下!");
    return false;
    }
      

  4.   

    手工配置一遍,在控制面板--管理工具--ODBC数据源里面配。
      

  5.   

    配完之后怎么和程序关联在一起呢
    我用的是#import "c:\program files\common files\system\ado\msado15.dll" \
    no_namespace \
    rename ("EOF", "adoEOF") rename("BOF","adoBOF") 
    这种方法来连接的啊
    不知道为什么
    请高手指点一下吧