龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > VC开发 >

VC下的ADO编程入门(2-4)(2)

时间:2009-12-30 15:42来源:未知 作者:admin 点击:
分享到:
(bstrQuery),vNULL,adOpenDynamic,adLockOptimistic,adCmdText); if(SUCCEEDED(hr)) { m_IsConnectionOpen=true; } } } } } catch(_com_error e) { _bstr_t bstrSource(e.Source()); _bstr_t bstrDescription(e.Descr
(bstrQuery),vNULL,adOpenDynamic,adLockOptimistic,adCmdText);

                                               if(SUCCEEDED(hr))

                                               {

                                                         m_IsConnectionOpen=true;

                                               }

                                     }

                            }

                   }

         }

         catch(_com_error &e)

         {

                   _bstr_t bstrSource(e.Source());

                   _bstr_t bstrDescription(e.Description());

                   TRACE("Exception throw for classes generated by #import");

                   TRACE(" Code=%08lx ", e.Error);

                   TRACE(" Code meaning = %s ", e.ErrorMessage);

                   TRACE(" Source = %s ", (LPCTSTR)bstrSource);

                   TRACE(" Description = %s ", (LPCTSTR)bstrDescription);

         }

         catch(...)

         {

                   TRACE("Unhandled Exception");

         }

n          添加对话框的WM_Destroy消息响应函数

void CZjyDlg::OnDestroy()

{

         CDialog::OnDestroy();

        

         // TODO: Add your message handler code here

         if(m_IsConnectionOpen)

         {

精彩图集

赞助商链接