我的odbc代码在console模式下调完了,但拿到ispai程序理,不好使.我的数据库在odbc里是"系统DSN"下建的.

解决方案 »

  1.   

    this->StartContent(pCtxt);
       this->WriteTitle(pCtxt);
       CDatabase db;
       try
       {
       db.Open( NULL, //£¨ÏµÍ³Ô´Ãû£©
                    FALSE, //bExclusive
                    FALSE, //bReadOnly
                    _T("ODBC;DSN=user"), //lpszConnect £¨ÓëÊý¾Ý¿âµÄÁ¬½Ó·½Ê½£©
                    FALSE);             
       }
       catch(CDBException* pEx)
       { 
       //bUseCursorLib 
            TCHAR szErrorMessage[1024];
            if (pEx->GetErrorMessage(szErrorMessage, sizeof(szErrorMessage)))
    {
               *pCtxt << szErrorMessage;
               *pCtxt << _T("\r\n");
    }
           *pCtxt << "Could not open database.";
       this->EndContent(pCtxt);
           return;   
       }   在网页里输出是。   在连接池生效时只允许 SQL_DRIVER_NOPROMPT Could not open database   怎么回事 ?  难道我要作个sql数据库吗 ?