我的DAO程序打开97的数据库没有问题,但打开2000的数据库是会出现一个替是对话框,写着“Unrecognized database format”的信息。该怎样打开2000的数据库呢?

解决方案 »

  1.   

    BOOL CYourApp::InitInstance()
    {
       AfxEnableControlContainer();
       AfxGetModuleState()->m_dwVersion = 0x0601; //增加此行
       .....
    }
      

  2.   

    http://www.csdn.net/Develop/read_article.asp?id=7751
      

  3.   

    谢谢zhf0021!现在可以打开了
    再请问一下:
    BOOL CADODatabase::Open()
    {
        m_bOpened=FALSE;
    try
    {    HRESULT hResult;
        hResult = m_pCon.CreateInstance(__uuidof(Connection));
        int i = GetLastError();
        if(hResult)
       {
       
        m_pCon->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source= F:\\trouble.mdb", "", "", adModeUnknown);
        m_bOpened=TRUE;
    }
    }
    }
    其中:m_pCon 是 _ConnectionPtr 型
          m_bOpen 是 BOOL 型 
       debug 后 i = 126 请问那里出错了?