谁可以给我一个VC6调用ORACLE的例子,或者文章的连接。邮箱:[email protected]

解决方案 »

  1.   

    BOOL CDlgDBConnect::ConnectOracle()
    {
    if (m_strService.IsEmpty())
    {
    ::MessageBox(NULL,"·þÎñÃû²»ÄÜΪ¿Õ","Ìáʾ",MB_OK);
    return FALSE;
    } theApp.m_pConnection.CreateInstance(__uuidof(Connection)); 
    try                 
    {
    //OLEDBÇý¶¯
    theApp.m_strDatabase=m_strService;
    CString strConn;
    strConn="Provider=OraOLEDB.Oracle.1;Password=";
    strConn+=m_strPassword;
    strConn+=";Persist Security Info=True;User ID=";
    strConn+=m_strUsername;
    // strConn+=";SERVER=";
    // strConn+=m_strService;
    strConn+=";Data Source=";
    strConn+= m_strService;
    theApp.m_pConnection->Open((_bstr_t)strConn,
       "",
       "",
       adModeUnknown);
    }
    catch(_com_error e)
    {
    ::MessageBox(NULL,e.Description(),"Ìáʾ",MB_OK);
    return FALSE;
    }

    ::MessageBox(NULL,"Êý¾Ý¿âÁ¬½Ó³É¹¦£¡","Ìáʾ",MB_OK);
    return TRUE;}
      

  2.   

    这个是ADO的吧   有没有OCI的??可不可以给个稍微完整点的例子呀链接也可以