1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir #ifndef _CONNECTIVITY_ADO_ADOIMP_HXX_ 28*cdf0e10cSrcweir #define _CONNECTIVITY_ADO_ADOIMP_HXX_ 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #include <com/sun/star/sdbc/SQLException.hpp> 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir #include "ado_pre_sys_include.h" 33*cdf0e10cSrcweir #include <adoctint.h> 34*cdf0e10cSrcweir #include "ado_post_sys_include.h" 35*cdf0e10cSrcweir 36*cdf0e10cSrcweir struct ADOConnection; 37*cdf0e10cSrcweir enum DataTypeEnum; 38*cdf0e10cSrcweir namespace connectivity 39*cdf0e10cSrcweir { 40*cdf0e10cSrcweir namespace ado 41*cdf0e10cSrcweir { 42*cdf0e10cSrcweir 43*cdf0e10cSrcweir class WpADOField; 44*cdf0e10cSrcweir class OLEString; 45*cdf0e10cSrcweir class ADOS 46*cdf0e10cSrcweir { 47*cdf0e10cSrcweir public: 48*cdf0e10cSrcweir // Auch hier: BSTR mit SysFreeString() freigeben! 49*cdf0e10cSrcweir static OLEString& GetKeyStr(); 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir static const CLSID CLSID_ADOCATALOG_25; 52*cdf0e10cSrcweir static const IID IID_ADOCATALOG_25; 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir static const CLSID CLSID_ADOCONNECTION_21; 55*cdf0e10cSrcweir static const IID IID_ADOCONNECTION_21; 56*cdf0e10cSrcweir 57*cdf0e10cSrcweir static const CLSID CLSID_ADOCOMMAND_21; 58*cdf0e10cSrcweir static const IID IID_ADOCOMMAND_21; 59*cdf0e10cSrcweir 60*cdf0e10cSrcweir static const CLSID CLSID_ADORECORDSET_21; 61*cdf0e10cSrcweir static const IID IID_ADORECORDSET_21; 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir static const CLSID CLSID_ADOINDEX_25; 64*cdf0e10cSrcweir static const IID IID_ADOINDEX_25; 65*cdf0e10cSrcweir 66*cdf0e10cSrcweir static const CLSID CLSID_ADOCOLUMN_25; 67*cdf0e10cSrcweir static const IID IID_ADOCOLUMN_25; 68*cdf0e10cSrcweir 69*cdf0e10cSrcweir static const CLSID CLSID_ADOKEY_25; 70*cdf0e10cSrcweir static const IID IID_ADOKEY_25; 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir static const CLSID CLSID_ADOTABLE_25; 73*cdf0e10cSrcweir static const IID IID_ADOTABLE_25; 74*cdf0e10cSrcweir 75*cdf0e10cSrcweir static const CLSID CLSID_ADOGROUP_25; 76*cdf0e10cSrcweir static const IID IID_ADOGROUP_25; 77*cdf0e10cSrcweir 78*cdf0e10cSrcweir static const CLSID CLSID_ADOUSER_25; 79*cdf0e10cSrcweir static const IID IID_ADOUSER_25; 80*cdf0e10cSrcweir 81*cdf0e10cSrcweir static const CLSID CLSID_ADOVIEW_25; 82*cdf0e10cSrcweir static const IID IID_ADOVIEW_25; 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir static void ThrowException(ADOConnection* _pAdoCon,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 85*cdf0e10cSrcweir static sal_Int32 MapADOType2Jdbc(DataTypeEnum eType); 86*cdf0e10cSrcweir static DataTypeEnum MapJdbc2ADOType(sal_Int32 _nType,sal_Int32 _nJetEngine); 87*cdf0e10cSrcweir static sal_Bool isJetEngine(sal_Int32 _nEngineType); 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir static ObjectTypeEnum mapObjectType2Ado(sal_Int32 objType); 90*cdf0e10cSrcweir static sal_Int32 mapAdoType2Object(ObjectTypeEnum objType); 91*cdf0e10cSrcweir static sal_Int32 mapAdoRights2Sdbc(RightsEnum eRights); 92*cdf0e10cSrcweir static sal_Int32 mapRights2Ado(sal_Int32 nRights); 93*cdf0e10cSrcweir 94*cdf0e10cSrcweir static WpADOField getField(ADORecordset* _pRecordSet,sal_Int32 _nColumnIndex) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 95*cdf0e10cSrcweir }; 96*cdf0e10cSrcweir 97*cdf0e10cSrcweir 98*cdf0e10cSrcweir } 99*cdf0e10cSrcweir } 100*cdf0e10cSrcweir 101*cdf0e10cSrcweir #define ADO_PROP(ItemName) \ 102*cdf0e10cSrcweir WpADOProperty aProp(aProps.GetItem(ItemName)); \ 103*cdf0e10cSrcweir OLEVariant aVar; \ 104*cdf0e10cSrcweir if(aProp.IsValid()) \ 105*cdf0e10cSrcweir aVar = aProp.GetValue(); \ 106*cdf0e10cSrcweir else \ 107*cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 108*cdf0e10cSrcweir 109*cdf0e10cSrcweir 110*cdf0e10cSrcweir #endif //_CONNECTIVITY_ADO_ADOIMP_HXX_ 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir 113