⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msado15.tli

📁 用VC编写基于ADO的数据库程序
💻 TLI
📖 第 1 页 / 共 4 页
字号:

inline _RecordsetPtr _Connection::Execute ( _bstr_t CommandText, VARIANT * RecordsAffected, long Options ) {
    struct _Recordset * _result;
    HRESULT _hr = raw_Execute(CommandText, RecordsAffected, Options, &_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _RecordsetPtr(_result, false);
}

inline long _Connection::BeginTrans ( ) {
    long _result;
    HRESULT _hr = raw_BeginTrans(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

inline HRESULT _Connection::CommitTrans ( ) {
    HRESULT _hr = raw_CommitTrans();
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _hr;
}

inline HRESULT _Connection::RollbackTrans ( ) {
    HRESULT _hr = raw_RollbackTrans();
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _hr;
}

inline HRESULT _Connection::Open ( _bstr_t ConnectionString, _bstr_t UserID, _bstr_t Password, long Options ) {
    HRESULT _hr = raw_Open(ConnectionString, UserID, Password, Options);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _hr;
}

inline ErrorsPtr _Connection::GetErrors ( ) {
    struct Errors * _result;
    HRESULT _hr = get_Errors(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return ErrorsPtr(_result, false);
}

inline _bstr_t _Connection::GetDefaultDatabase ( ) {
    BSTR _result;
    HRESULT _hr = get_DefaultDatabase(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _bstr_t(_result, false);
}

inline void _Connection::PutDefaultDatabase ( _bstr_t pbstr ) {
    HRESULT _hr = put_DefaultDatabase(pbstr);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}

inline enum IsolationLevelEnum _Connection::GetIsolationLevel ( ) {
    enum IsolationLevelEnum _result;
    HRESULT _hr = get_IsolationLevel(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

inline void _Connection::PutIsolationLevel ( enum IsolationLevelEnum Level ) {
    HRESULT _hr = put_IsolationLevel(Level);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}

inline long _Connection::GetAttributes ( ) {
    long _result;
    HRESULT _hr = get_Attributes(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

inline void _Connection::PutAttributes ( long plAttr ) {
    HRESULT _hr = put_Attributes(plAttr);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}

inline enum CursorLocationEnum _Connection::GetCursorLocation ( ) {
    enum CursorLocationEnum _result;
    HRESULT _hr = get_CursorLocation(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

inline void _Connection::PutCursorLocation ( enum CursorLocationEnum plCursorLoc ) {
    HRESULT _hr = put_CursorLocation(plCursorLoc);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}

inline enum ConnectModeEnum _Connection::GetMode ( ) {
    enum ConnectModeEnum _result;
    HRESULT _hr = get_Mode(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

inline void _Connection::PutMode ( enum ConnectModeEnum plMode ) {
    HRESULT _hr = put_Mode(plMode);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}

inline _bstr_t _Connection::GetProvider ( ) {
    BSTR _result;
    HRESULT _hr = get_Provider(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _bstr_t(_result, false);
}

inline void _Connection::PutProvider ( _bstr_t pbstr ) {
    HRESULT _hr = put_Provider(pbstr);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}

inline long _Connection::GetState ( ) {
    long _result;
    HRESULT _hr = get_State(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

inline _RecordsetPtr _Connection::OpenSchema ( enum SchemaEnum Schema, const _variant_t & Restrictions, const _variant_t & SchemaID ) {
    struct _Recordset * _result;
    HRESULT _hr = raw_OpenSchema(Schema, Restrictions, SchemaID, &_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _RecordsetPtr(_result, false);
}

inline HRESULT _Connection::Cancel ( ) {
    HRESULT _hr = raw_Cancel();
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _hr;
}

//
// interface _Recordset wrapper method implementations
//

inline enum PositionEnum _Recordset::GetAbsolutePosition ( ) {
    enum PositionEnum _result;
    HRESULT _hr = get_AbsolutePosition(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

inline void _Recordset::PutAbsolutePosition ( enum PositionEnum pl ) {
    HRESULT _hr = put_AbsolutePosition(pl);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}

inline void _Recordset::PutRefActiveConnection ( IDispatch * pvar ) {
    HRESULT _hr = putref_ActiveConnection(pvar);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}

inline void _Recordset::PutActiveConnection ( const _variant_t & pvar ) {
    HRESULT _hr = put_ActiveConnection(pvar);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}

inline _variant_t _Recordset::GetActiveConnection ( ) {
    VARIANT _result;
    VariantInit(&_result);
    HRESULT _hr = get_ActiveConnection(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _variant_t(_result, false);
}

inline VARIANT_BOOL _Recordset::GetBOF ( ) {
    VARIANT_BOOL _result;
    HRESULT _hr = get_BOF(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

inline _variant_t _Recordset::GetBookmark ( ) {
    VARIANT _result;
    VariantInit(&_result);
    HRESULT _hr = get_Bookmark(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _variant_t(_result, false);
}

inline void _Recordset::PutBookmark ( const _variant_t & pvBookmark ) {
    HRESULT _hr = put_Bookmark(pvBookmark);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}

inline long _Recordset::GetCacheSize ( ) {
    long _result;
    HRESULT _hr = get_CacheSize(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

inline void _Recordset::PutCacheSize ( long pl ) {
    HRESULT _hr = put_CacheSize(pl);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}

inline enum CursorTypeEnum _Recordset::GetCursorType ( ) {
    enum CursorTypeEnum _result;
    HRESULT _hr = get_CursorType(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

inline void _Recordset::PutCursorType ( enum CursorTypeEnum plCursorType ) {
    HRESULT _hr = put_CursorType(plCursorType);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}

inline VARIANT_BOOL _Recordset::GetEndOfFile ( ) {
    VARIANT_BOOL _result;
    HRESULT _hr = get_EndOfFile(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

inline FieldsPtr _Recordset::GetFields ( ) {
    struct Fields * _result;
    HRESULT _hr = get_Fields(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return FieldsPtr(_result, false);
}

inline enum LockTypeEnum _Recordset::GetLockType ( ) {
    enum LockTypeEnum _result;
    HRESULT _hr = get_LockType(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

inline void _Recordset::PutLockType ( enum LockTypeEnum plLockType ) {
    HRESULT _hr = put_LockType(plLockType);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}

inline long _Recordset::GetMaxRecords ( ) {
    long _result;
    HRESULT _hr = get_MaxRecords(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

inline void _Recordset::PutMaxRecords ( long plMaxRecords ) {
    HRESULT _hr = put_MaxRecords(plMaxRecords);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}

inline long _Recordset::GetRecordCount ( ) {
    long _result;
    HRESULT _hr = get_RecordCount(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

inline void _Recordset::PutRefSource ( IDispatch * pvSource ) {
    HRESULT _hr = putref_Source(pvSource);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}

inline void _Recordset::PutSource ( _bstr_t pvSource ) {
    HRESULT _hr = put_Source(pvSource);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}

inline _variant_t _Recordset::GetSource ( ) {
    VARIANT _result;
    VariantInit(&_result);
    HRESULT _hr = get_Source(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _variant_t(_result, false);
}

inline HRESULT _Recordset::AddNew ( const _variant_t & FieldList, const _variant_t & Values ) {
    HRESULT _hr = raw_AddNew(FieldList, Values);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _hr;
}

inline HRESULT _Recordset::CancelUpdate ( ) {
    HRESULT _hr = raw_CancelUpdate();
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _hr;
}

inline HRESULT _Recordset::Close ( ) {
    HRESULT _hr = raw_Close();
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _hr;
}

inline HRESULT _Recordset::Delete ( enum AffectEnum AffectRecords ) {
    HRESULT _hr = raw_Delete(AffectRecords);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _hr;
}

inline _variant_t _Recordset::GetRows ( long Rows, const _variant_t & Start, const _variant_t & Fields ) {
    VARIANT _result;
    VariantInit(&_result);
    HRESULT _hr = raw_GetRows(Rows, Start, Fields, &_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _variant_t(_result, false);
}

inline HRESULT _Recordset::Move ( long NumRecords, const _variant_t & Start ) {
    HRESULT _hr = raw_Move(NumRecords, Start);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _hr;
}

inline HRESULT _Recordset::MoveNext ( ) {
    HRESULT _hr = raw_MoveNext();
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _hr;
}

inline HRESULT _Recordset::MovePrevious ( ) {
    HRESULT _hr = raw_MovePrevious();
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _hr;
}

inline HRESULT _Recordset::MoveFirst ( ) {
    HRESULT _hr = raw_MoveFirst();
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _hr;
}

inline HRESULT _Recordset::MoveLast ( ) {
    HRESULT _hr = raw_MoveLast();
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _hr;
}

inline HRESULT _Recordset::Open ( const _variant_t & Source, const _variant_t & ActiveConnection, enum CursorTypeEnum CursorType, enum LockTypeEnum LockType, long Options ) {
    HRESULT _hr = raw_Open(Source, ActiveConnection, CursorType, LockType, Options);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _hr;
}

inline HRESULT _Recordset::Requery ( long Options ) {
    HRESULT _hr = raw_Requery(Options);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _hr;
}

inline HRESULT _Recordset::_xResync ( enum AffectEnum AffectRecords ) {
    HRESULT _hr = raw__xResync(AffectRecords);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _hr;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -