CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2001
    Posts
    1

    c++ and Oracle connectivity

    Sir,

    I want to connect C++ with Oracle . So that I can take data from menu made in c++ and Store data in Oracle tables .
    amitesh

    ad

  2. #2
    Join Date
    Apr 2001
    Posts
    13

    Re: c++ and Oracle connectivity

    TESTHR(pConn.CreateInstance(__uuidof(Connection)));
    TESTHR(pRS.CreateInstance(__uuidof(Recordset)));

    try
    {
    pConn->Open("Provider=sqloledb;Data Source=Sydney;"
    "Initial Catalog=radio;User Id=sa;Password=f1ng3rs;","","",adConnectUnspecified);
    pRS->PutRefActiveConnection(pConn);
    pRS->Open("SELECT artistname, albumname, songname, fileLocationASF, fileLocationRA, songID FROM song WHERE uploadedToISP=0 ORDER BY songID DESC;",
    vtMissing, adOpenForwardOnly, adLockReadOnly, adCmdText);


    while (!pRS->adoEOF)
    {
    vtArtist = pRS->Fields->GetItem((long)0)->GetValue();
    vtAlbum = pRS->Fields->GetItem((long)1)->GetValue();
    vtSong = pRS->Fields->GetItem((long)2)->GetValue();
    vtFileLocationASF = pRS->Fields->GetItem((long)3)->GetValue();
    vtFileLocationRA = pRS->Fields->GetItem((long)4)->GetValue();
    vtSongID = pRS->Fields->GetItem((long)5)->GetValue();

    strBuff.Format("%s - %s - %s", (char*)((_bstr_t)vtArtist), (char*)((_bstr_t)vtAlbum), (char*)((_bstr_t)vtSong));
    BSTR bstrFilename = strBuff.AllocSysString();
    if (ftpUploadFile(bstrFilename, m_strFTPServername, (char*)((_bstr_t)vtFileLocationASF), (char*)((_bstr_t)vtFileLocationRA), m_strFTPASFRoot, m_strFTPRARoot))
    {
    strBuff.Format("radioUpdateUploadedToISP %li", vtSongID.lVal);
    //AfxMessageBox(strSQL);
    BSTR bstrSQL = strBuff.AllocSysString();
    pConn->Execute(bstrSQL, NULL, adExecuteNoRecords);
    SysFreeString(bstrSQL);
    pRS->MoveNext();
    }
    SysFreeString(bstrFilename);
    }
    pRS->Close();
    pConn->Close();
    }
    catch (_com_error)
    {

    }


  3. #3
    Join Date
    Apr 1999
    Posts
    27,449

    Re: c++ and Oracle connectivity

    I have little experience with C++ and Oracle, but maybe you should take a look at this:

    http://www.geocities.com/skuchin/otl/home.htm

    Regards,

    Paul McKenzie


  4. #4
    Join Date
    Oct 1999
    Location
    Mumbai, India
    Posts
    207

    Re: c++ and Oracle connectivity

    Hi,

    You can use the standard ODBC API, provided by Microsoft.
    It is a set of functions to access and use any database. The
    detailed help on these functions and their usage is available in
    MSDN.

    You will also need any ODBC driver for the Oracle RDBMS. Common
    ones are those from Oracle and Microsoft.

    The Oracle ODBC driver for Oracle RDBMS (SQORA32.DLL) gets
    installed when you install Oracle client on your machine.

    The Microsoft ODBC driver for Oracle RDBMS (MSORCL32.DLL)
    comes bundled with Win2K.

    Hope this helps.

    With best regards,
    Sayan



    Sayan Mukherjee
    Calcutta (INDIA)
    Email: [email protected]
    Thank you.
    Sayan
    ====================

    Sayan Mukherjee
    [Email: [email protected]]

  5. #5
    Join Date
    Apr 2000
    Location
    Frederick, Maryland
    Posts
    507

    Re: c++ and Oracle connectivity

    I have done little bit work on it and make a small frame work which fullfill my requirment by directly calling Oracle Native API i.e. OCI (Oracle Call Interface).

    you can take a look at

    http://www.codeguru.com/mfc_database/OciClasses1.shtml
    http://www.codeguru.com/mfc_database/Osql10.shtml
    http://ocicpplib.sourceforge.net/
    http://gsinfo.sogang.ac.kr/~nicepat/callinterface.html
    http://www.firstobject.com/
    http://www.netcologne.de/~nc-poitscka/
    http://freespace.virgin.net/j.hatcher/ociwrap.htm

    Hope it helps.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured