打印本文 打印本文 关闭窗口 关闭窗口
ADO访问Oracle结果集的心得
作者:武汉SEO闵涛  文章来源:敏韬网  点击数5580  更新时间:2009/4/23 10:36:08  文章录入:mintao  责任编辑:mintao
                                       //
/**////////////////////////////////////////////////////////////
void main()
{
    HRESULT  hr = S_OK;

    if(FAILED(::CoInitialize(NULL)))
        return;

    ExecuteSql();
    
    //Wait here for the user to see the output.
    printf("\n\n按任意键继续");
    getch();
    ::CoUninitialize(); 
}


/**////////////////////////////////////////////////////////////
//                                                       //
//      ExecuteSql Function                              //
//                                                       //
/**////////////////////////////////////////////////////////////
VOID  ExecuteSql(VOID)
{

    HRESULT hr = S_OK;

    // Define ADO object pointers.
    // Initialize pointers on define.
    // These are in the ADODB::  namespace.
    _RecordsetPtr pRs = NULL; 
    _CommandPtr pCmd = NULL;
    _ParameterPtr pPrmParam1 = NULL;
    _ParameterPtr pPrmParam3 = NULL;
    _ConnectionPtr pConnection = NULL;

    _bstr_t strCnn("Provider=OraOLEDB.Oracle;Data Source=Console;User Id=aol;Password=123;");

    _bstr_t strMessage, strAuthorID;

    int intParam1;

上一页  [1] [2] [3] [4] [5]  下一页

打印本文 打印本文 关闭窗口 关闭窗口