高级会员
注册日期: 06-11
帖子: 1527
精华: 15
现金: 6353 标准币
资产: 6353 标准币
|
回复: Adoaccessor.dsw工程
3.ADOTier.h
// ADOTier.h : Declaration of the CADOTier
#ifndef __ADOTIER_H_
#define __ADOTIER_H_
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CADOTier
class ATL_NO_VTABLE CADOTier :
public CComObjectRootEx<CComSingleThreadModel>,
public ISupportErrorInfo,
public CComCoClass<CADOTier, &CLSID_ADOTier>,
public IDispatchImpl<IADOTier, &IID_IADOTier, &LIBID_ADOACCESSORLib>
{
public:
CADOTier()
{
}
DECLARE_REGISTRY_RESOURCEID(IDR_ADOTIER)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(CADOTier)
COM_INTERFACE_ENTRY(IADOTier)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(ISupportErrorInfo)
END_COM_MAP()
// ISupportsErrorInfo
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
// IADOTier
public:
STDMETHOD(get_Empty)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(ADORelease)();
STDMETHOD(Requery)();
STDMETHOD(ChangeParameter)(/*[in]*/ long idx, /*[in]*/ enum DataTypeEnum type, /*[in]*/ VARIANT value, /*[in]*/ enum ParameterDirectionEnum where, /*[in]*/ long size);
STDMETHOD(put_StoredProc)(/*[in]*/ BSTR newVal);
STDMETHOD(CallStoredProc)(/*[in]*/ long idx1, /*[in]*/ BSTR idx2, /*[in]*/ BSTR idx3);
STDMETHOD(ParamQuery)(/*[in]*/ BSTR query, /*[in]*/ long idx1, /*[in]*/ BSTR idx2, /*[in]*/ BSTR idx3);
STDMETHOD(get_BOF)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(get_EOF)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(Prev)();
STDMETHOD(Last)();
STDMETHOD(Next)();
STDMETHOD(First)();
STDMETHOD(Close)();
STDMETHOD(get_FieldCount)(/*[out, retval]*/ long *pVal);
STDMETHODIMP put_FieldCount(/*[in]*/ long pVal);
STDMETHOD(get_Field)(/*[in]*/ VARIANT idx, /*[out, retval]*/ VARIANT *pVal);
STDMETHOD(put_Field)(/*[in]*/ VARIANT idx, /*[in]*/ VARIANT newVal);
STDMETHOD(Delete)();
STDMETHOD(Update)();
STDMETHOD(AppendParameter)(/*[in]*/ enum DataTypeEnum type, /*[in]*/ VARIANT value, /*[in]*/ enum ParameterDirectionEnum where, /*[in]*/ long size);
STDMETHOD(get_CommandText)(/*[out, retval]*/ BSTR *pVal);
STDMETHOD(put_CommandText)(/*[in]*/ BSTR newVal);
STDMETHOD(ExecuteCommand)(/*[in]*/ VARIANT_BOOL bStoredProcedure, /*[in]*/ VARIANT_BOOL bChangeRec);
STDMETHOD(ExecuteConnection)(/*[in]*/ BSTR query, /*[in]*/ VARIANT_BOOL bChangeRec);
STDMETHOD(CloseRecordset)(void);
STDMETHOD(OpenRecordset)(/*[in]*/ VARIANT query);
STDMETHOD(Open)(/*[in]*/ BSTR source, /*[in]*/ BSTR user, /*[in]*/ BSTR pwd);
private:
_CommandPtr m_command;
_RecordsetPtr m_recordset;
_ConnectionPtr m_connection;
};
#endif //__ADOTIER_H_
|