1*caf5cd79SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*caf5cd79SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*caf5cd79SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*caf5cd79SAndrew Rist * distributed with this work for additional information 6*caf5cd79SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*caf5cd79SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*caf5cd79SAndrew Rist * "License"); you may not use this file except in compliance 9*caf5cd79SAndrew Rist * with the License. You may obtain a copy of the License at 10*caf5cd79SAndrew Rist * 11*caf5cd79SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*caf5cd79SAndrew Rist * 13*caf5cd79SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*caf5cd79SAndrew Rist * software distributed under the License is distributed on an 15*caf5cd79SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*caf5cd79SAndrew Rist * KIND, either express or implied. See the License for the 17*caf5cd79SAndrew Rist * specific language governing permissions and limitations 18*caf5cd79SAndrew Rist * under the License. 19*caf5cd79SAndrew Rist * 20*caf5cd79SAndrew Rist *************************************************************/ 21*caf5cd79SAndrew Rist 22*caf5cd79SAndrew Rist 23cdf0e10cSrcweir #ifndef _CONNECTIVITY_ADO_ADOIMP_HXX_ 24cdf0e10cSrcweir #define _CONNECTIVITY_ADO_ADOIMP_HXX_ 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <com/sun/star/sdbc/SQLException.hpp> 27cdf0e10cSrcweir 28cdf0e10cSrcweir #include "ado_pre_sys_include.h" 29cdf0e10cSrcweir #include <adoctint.h> 30cdf0e10cSrcweir #include "ado_post_sys_include.h" 31cdf0e10cSrcweir 32cdf0e10cSrcweir struct ADOConnection; 33cdf0e10cSrcweir enum DataTypeEnum; 34cdf0e10cSrcweir namespace connectivity 35cdf0e10cSrcweir { 36cdf0e10cSrcweir namespace ado 37cdf0e10cSrcweir { 38cdf0e10cSrcweir 39cdf0e10cSrcweir class WpADOField; 40cdf0e10cSrcweir class OLEString; 41cdf0e10cSrcweir class ADOS 42cdf0e10cSrcweir { 43cdf0e10cSrcweir public: 44cdf0e10cSrcweir // Auch hier: BSTR mit SysFreeString() freigeben! 45cdf0e10cSrcweir static OLEString& GetKeyStr(); 46cdf0e10cSrcweir 47cdf0e10cSrcweir static const CLSID CLSID_ADOCATALOG_25; 48cdf0e10cSrcweir static const IID IID_ADOCATALOG_25; 49cdf0e10cSrcweir 50cdf0e10cSrcweir static const CLSID CLSID_ADOCONNECTION_21; 51cdf0e10cSrcweir static const IID IID_ADOCONNECTION_21; 52cdf0e10cSrcweir 53cdf0e10cSrcweir static const CLSID CLSID_ADOCOMMAND_21; 54cdf0e10cSrcweir static const IID IID_ADOCOMMAND_21; 55cdf0e10cSrcweir 56cdf0e10cSrcweir static const CLSID CLSID_ADORECORDSET_21; 57cdf0e10cSrcweir static const IID IID_ADORECORDSET_21; 58cdf0e10cSrcweir 59cdf0e10cSrcweir static const CLSID CLSID_ADOINDEX_25; 60cdf0e10cSrcweir static const IID IID_ADOINDEX_25; 61cdf0e10cSrcweir 62cdf0e10cSrcweir static const CLSID CLSID_ADOCOLUMN_25; 63cdf0e10cSrcweir static const IID IID_ADOCOLUMN_25; 64cdf0e10cSrcweir 65cdf0e10cSrcweir static const CLSID CLSID_ADOKEY_25; 66cdf0e10cSrcweir static const IID IID_ADOKEY_25; 67cdf0e10cSrcweir 68cdf0e10cSrcweir static const CLSID CLSID_ADOTABLE_25; 69cdf0e10cSrcweir static const IID IID_ADOTABLE_25; 70cdf0e10cSrcweir 71cdf0e10cSrcweir static const CLSID CLSID_ADOGROUP_25; 72cdf0e10cSrcweir static const IID IID_ADOGROUP_25; 73cdf0e10cSrcweir 74cdf0e10cSrcweir static const CLSID CLSID_ADOUSER_25; 75cdf0e10cSrcweir static const IID IID_ADOUSER_25; 76cdf0e10cSrcweir 77cdf0e10cSrcweir static const CLSID CLSID_ADOVIEW_25; 78cdf0e10cSrcweir static const IID IID_ADOVIEW_25; 79cdf0e10cSrcweir 80cdf0e10cSrcweir 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); 81cdf0e10cSrcweir static sal_Int32 MapADOType2Jdbc(DataTypeEnum eType); 82cdf0e10cSrcweir static DataTypeEnum MapJdbc2ADOType(sal_Int32 _nType,sal_Int32 _nJetEngine); 83cdf0e10cSrcweir static sal_Bool isJetEngine(sal_Int32 _nEngineType); 84cdf0e10cSrcweir 85cdf0e10cSrcweir static ObjectTypeEnum mapObjectType2Ado(sal_Int32 objType); 86cdf0e10cSrcweir static sal_Int32 mapAdoType2Object(ObjectTypeEnum objType); 87cdf0e10cSrcweir static sal_Int32 mapAdoRights2Sdbc(RightsEnum eRights); 88cdf0e10cSrcweir static sal_Int32 mapRights2Ado(sal_Int32 nRights); 89cdf0e10cSrcweir 90cdf0e10cSrcweir static WpADOField getField(ADORecordset* _pRecordSet,sal_Int32 _nColumnIndex) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 91cdf0e10cSrcweir }; 92cdf0e10cSrcweir 93cdf0e10cSrcweir 94cdf0e10cSrcweir } 95cdf0e10cSrcweir } 96cdf0e10cSrcweir 97cdf0e10cSrcweir #define ADO_PROP(ItemName) \ 98cdf0e10cSrcweir WpADOProperty aProp(aProps.GetItem(ItemName)); \ 99cdf0e10cSrcweir OLEVariant aVar; \ 100cdf0e10cSrcweir if(aProp.IsValid()) \ 101cdf0e10cSrcweir aVar = aProp.GetValue(); \ 102cdf0e10cSrcweir else \ 103cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 104cdf0e10cSrcweir 105cdf0e10cSrcweir 106cdf0e10cSrcweir #endif //_CONNECTIVITY_ADO_ADOIMP_HXX_ 107cdf0e10cSrcweir 108cdf0e10cSrcweir 109