打印本文 打印本文 关闭窗口 关闭窗口
用Delphi的思想初步构建C++的ADO对象
作者:武汉SEO闵涛  文章来源:敏韬网  点击数3708  更新时间:2009/4/23 10:43:17  文章录入:mintao  责任编辑:mintao

 

void CTestDataAccessDlg::Open()

{

       // TODO: Add your control notification handler code here

       m_AdoConnection.ConnectingString = "Provider=SQLOLEDB;Network Address=127.0.0.1;Initial Catalog=ere";

       m_AdoConnection.UserName = "sa";

       m_AdoConnection.PassWord = "S2k";

       if (m_AdoConnection.Connected == FALSE)

              m_AdoConnection.Connected = TRUE;

}

 

void CTestDataAccessDlg::Query()

{

       // TODO: Add your control notification handler code here

       m_AdoCommand.CommandType = adCmdText;

       m_AdoCommand.CommandText = "select count(*) from Form_common";

       m_AdoCommand.m_AdoConnection = &m_AdoConnection;

       m_AdoCommand.Execute();

}

 

void CTestDataAccessDlg::Close()

{

       // TODO: Add your control notification handler code here

       if (m_AdoConnection.Connected == TRUE)

              m_AdoConnection.Connected = FALSE;

}

 

 

好了,代码就是这些,能看明白吧?看不懂我也没办法 J

                                                                      温柔的毒药 3/24/2005

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

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