|
-
September 4th, 2001, 07:39 AM
#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
-
September 4th, 2001, 07:11 PM
#2
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)
{
}
-
September 4th, 2001, 08:29 PM
#3
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
-
September 4th, 2001, 08:42 PM
#4
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]
-
September 5th, 2001, 12:26 AM
#5
Re: c++ and Oracle connectivity
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|