哪位高手有VC6调用ORACLE的简单的例子
谁有VC6调用ORACLE的简单的例子
谁可以给我一个VC6调用ORACLE的例子,或者文章的连接。
邮箱:love2008@itpub.net
------解决方案--------------------
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;
}
------解决方案--------------------
OCI的,参考oracle的文档吧
谁可以给我一个VC6调用ORACLE的例子,或者文章的连接。
邮箱:love2008@itpub.net
------解决方案--------------------
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;
}
------解决方案--------------------
OCI的,参考oracle的文档吧