解决方案 »

  1.   

    错误日志只有警告没有错误,程序是使用的ado的接口,程序代码如下:
    /////////////////////////////////////
    //用两个参数打开数据集
    //
    /////////////////////////////////////
    BOOL CADORecordset::Open(variant_t Source )
    {
    HRESULT hr ;
    if(m_pRSet == NULL)
    return FALSE ;
    if(m_pRSet->State == adStateOpen)  //when the rs is open ,must close it first ..
    m_pRSet->Close() ;

    try
    {
    m_pRSet->CursorType = adOpenStatic;
    m_pRSet->CursorLocation = adUseClient;
    hr = m_pRSet->Open((char*)_bstr_t(Source),m_pConn.GetInterfacePtr(),adOpenKeyset,//adOpenStatic,//,adOpenDynamic 
    adLockOptimistic,adCmdText) ;
    }
    catch(_com_error &e)
    {

    #ifdef _CONSOLE
    printf("错误提示:") ;
    printf(e.Description()) ;
    printf("\r\n") ;
    #else
    MessageBox(NULL,e.Description(),"提示", MB_OK|MB_ICONWARNING) ;
    MessageBox(NULL,(char*)_bstr_t(Source),"提示", MB_OK|MB_ICONWARNING) ;#endif
    int kk = GetLastError();
    return FALSE ;
    }
    if(SUCCEEDED(hr))
    {
    return TRUE ;
    }
    return FALSE ;
    }
    其中Source为sql语句,sql语句在数据库里面测试已经通过,出现上面的问题主要是把数据库从access移植到mysql后出现的问题,如果手动添加信息就不会出现上面的问题