DALMyBools.h
上传用户:weisheen
上传日期:2022-07-09
资源大小:19390k
文件大小:2k
源码类别:
ActiveX/DCOM/ATL
开发平台:
Visual C++
- // DALMyBools.h : Declaration of the CDALMyBools
- #ifndef __DALMYBOOLS_H_
- #define __DALMYBOOLS_H_
- #include "resource.h" // main symbols
- #import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adEOF")
- /////////////////////////////////////////////////////////////////////////////
- // CDALMyBools
- class ATL_NO_VTABLE CDALMyBools :
- public CComObjectRootEx<CComSingleThreadModel>,
- public CComCoClass<CDALMyBools, &CLSID_DALMyBools>,
- public ISupportErrorInfo,
- public IDispatchImpl<IDALMyBools, &IID_IDALMyBools, &LIBID_BOOKSDALLib>
- {
- public:
- CDALMyBools()
- {
- this->m_sqlQueryById="select * from mybooks where bookisnb=?";
- this->m_sqlQueryAll="select * from mybooks";
- this->m_sqlUpdate="update mybooks set bookname=?,bookauthor=? where bookisnb=?";
- //CString m_sqlSave;
- //CString m_sqlDelete;
- }
- DECLARE_REGISTRY_RESOURCEID(IDR_DALMYBOOLS)
- DECLARE_PROTECT_FINAL_CONSTRUCT()
- BEGIN_COM_MAP(CDALMyBools)
- COM_INTERFACE_ENTRY(IDALMyBools)
- COM_INTERFACE_ENTRY(IDispatch)
- COM_INTERFACE_ENTRY(ISupportErrorInfo)
- END_COM_MAP()
- // ISupportsErrorInfo
- STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
- // IDALMyBools
- public:
- STDMETHOD(get_DataSource)(/*[out, retval]*/ BSTR *pVal);
- STDMETHOD(put_DataSource)(/*[in]*/ BSTR newVal);
- STDMETHOD(get_PWD)(/*[out, retval]*/ BSTR *pVal);
- STDMETHOD(put_PWD)(/*[in]*/ BSTR newVal);
- STDMETHOD(get_UID)(/*[out, retval]*/ BSTR *pVal);
- STDMETHOD(put_UID)(/*[in]*/ BSTR newVal);
- STDMETHOD(Update)(/*[in]*/ DTOBook* Book, /*[out]*/ UINT* iResult);
- STDMETHOD(DeleteBookById)(/*[in]*/ UINT id, /*[out]*/ UINT* iResult);
- STDMETHOD(SaveBook)(/*[in]*/ DTOBook* bookdata, /*[out]*/ UINT* pResult);
- STDMETHOD(QueryAllBook)(/*[out]*/ DTOBook** allBook);
- STDMETHOD(GetBookByIsbn)(/*[in]*/ UINT bookisbn,/*[out]*/ DTOBook** mybook);
- private:
- _ConnectionPtr GetMyConn();
- CString m_sqlQueryById;//通过ID查询
- CString m_sqlQueryAll;//查询所有
- CString m_sqlUpdate;//通过ID更新bookname、bookauthor
- CString m_sqlSave;
- CString m_sqlDelete;
- CString m_UID;//用户名:scott
- CString m_PWD;//密码:tiger
- CString m_DataSource;//数据源:tarena
- };
- #endif //__DALMYBOOLS_H_