diff options
author | Ocke Janssen <oj@openoffice.org> | 2001-05-14 10:42:44 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2001-05-14 10:42:44 +0000 |
commit | 0abbd65247f1527153ca8692d453bca72052a023 (patch) | |
tree | 872cdbeaef351a83688e06008c128a145ec119cd /connectivity/source/drivers/ado | |
parent | 3111f05ead7ee44b051faeb245e6538a9a796dd2 (diff) |
#86528# lower size need
Diffstat (limited to 'connectivity/source/drivers/ado')
24 files changed, 1008 insertions, 134 deletions
diff --git a/connectivity/source/drivers/ado/ACatalog.cxx b/connectivity/source/drivers/ado/ACatalog.cxx index aead9372ba78..1b1d59034f3a 100644 --- a/connectivity/source/drivers/ado/ACatalog.cxx +++ b/connectivity/source/drivers/ado/ACatalog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ACatalog.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: oj $ $Date: 2001-05-02 12:57:36 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:41:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -86,6 +86,7 @@ // ------------------------------------------------------------------------- +using namespace connectivity; using namespace connectivity::ado; // ------------------------------------------------------------------------- OCatalog::OCatalog(_ADOCatalog* _pCatalog,OConnection* _pCon) : connectivity::sdbcx::OCatalog(_pCon) diff --git a/connectivity/source/drivers/ado/AColumn.cxx b/connectivity/source/drivers/ado/AColumn.cxx index 7777f9f86819..118311fa3648 100644 --- a/connectivity/source/drivers/ado/AColumn.cxx +++ b/connectivity/source/drivers/ado/AColumn.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AColumn.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: oj $ $Date: 2001-04-30 10:11:26 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:41:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,10 +77,6 @@ #ifndef _COM_SUN_STAR_SDBC_COLUMNVALUE_HPP_ #include <com/sun/star/sdbc/ColumnValue.hpp> #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE ado -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" -#endif #ifndef _COMPHELPER_EXTRACT_HXX_ #include <comphelper/extract.hxx> #endif @@ -159,8 +155,8 @@ void OAdoColumn::construct() { sal_Int32 nAttrib = isNew() ? 0 : PropertyAttribute::READONLY; - registerProperty(PROPERTY_ISASCENDING, PROPERTY_ID_ISASCENDING, nAttrib,&m_IsAscending, ::getBooleanCppuType()); - registerProperty(PROPERTY_RELATEDCOLUMN, PROPERTY_ID_RELATEDCOLUMN, nAttrib,&m_ReferencedColumn, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL))); + registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISASCENDING), PROPERTY_ID_ISASCENDING, nAttrib,&m_IsAscending, ::getBooleanCppuType()); + registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RELATEDCOLUMN), PROPERTY_ID_RELATEDCOLUMN, nAttrib,&m_ReferencedColumn, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL))); } // ----------------------------------------------------------------------------- void OAdoColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)throw (Exception) diff --git a/connectivity/source/drivers/ado/AColumns.cxx b/connectivity/source/drivers/ado/AColumns.cxx index 9607b1d12718..5038e1ad7413 100644 --- a/connectivity/source/drivers/ado/AColumns.cxx +++ b/connectivity/source/drivers/ado/AColumns.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AColumns.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: oj $ $Date: 2001-04-27 11:38:25 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:41:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,10 +83,6 @@ #ifndef _COM_SUN_STAR_SDBC_COLUMNVALUE_HPP_ #include <com/sun/star/sdbc/ColumnValue.hpp> #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE ado -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" -#endif using namespace connectivity::ado; using namespace connectivity; using namespace com::sun::star::uno; @@ -135,7 +131,7 @@ void SAL_CALL OColumns::appendByDescriptor( const Reference< XPropertySet >& des ADOS::ThrowException(*m_pConnection->getConnection(),*this); } else - throw SQLException(::rtl::OUString::createFromAscii("Could not append column!"),*this,SQLSTATE_GENERAL,1000,Any()); + throw SQLException(::rtl::OUString::createFromAscii("Could not append column!"),*this,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); } OCollection_TYPE::appendByDescriptor(descriptor); diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx index 578d0a033910..407de502f738 100644 --- a/connectivity/source/drivers/ado/AConnection.cxx +++ b/connectivity/source/drivers/ado/AConnection.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AConnection.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: oj $ $Date: 2001-04-27 10:08:08 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:41:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -100,8 +100,8 @@ #include <cppuhelper/typeprovider.hxx> #endif +using namespace dbtools; using namespace connectivity::ado; -using namespace connectivity::dbtools; using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star::beans; diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx index ac8c9cffe9f5..fa4e01b43973 100644 --- a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx +++ b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ADatabaseMetaDataResultSet.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: oj $ $Date: 2001-05-02 12:57:36 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:42:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,10 +65,6 @@ #ifndef _CONNECTIVITY_ADO_ADATABASEMETADATARESULTSET_HXX_ #include "ado/ADatabaseMetaDataResultSet.hxx" #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE ado -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" -#endif #ifndef _CONNECTIVITY_ADO_ADATABASEMETADATARESULTSETMETADATA_HXX_ #include "ado/ADatabaseMetaDataResultSetMetaData.hxx" #endif @@ -105,6 +101,9 @@ #ifndef _COMPHELPER_SEQSTREAM_HXX #include <comphelper/seqstream.hxx> #endif +#ifndef _DBHELPER_DBEXCEPTION_HXX_ +#include "connectivity/dbexception.hxx" +#endif #include <oledb.h> diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSetMetaData.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSetMetaData.cxx index 315256501c67..107bcc627fee 100644 --- a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSetMetaData.cxx +++ b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSetMetaData.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ADatabaseMetaDataResultSetMetaData.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oj $ $Date: 2001-04-12 12:31:30 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,9 +76,8 @@ #ifndef _CONNECTIVITY_ADO_AWRAPADO_HXX_ #include "ado/Awrapado.hxx" #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE ado -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" +#ifndef _DBHELPER_DBEXCEPTION_HXX_ +#include "connectivity/dbexception.hxx" #endif using namespace connectivity; diff --git a/connectivity/source/drivers/ado/AGroup.cxx b/connectivity/source/drivers/ado/AGroup.cxx index afd08bcc0c83..ff399ca6729e 100644 --- a/connectivity/source/drivers/ado/AGroup.cxx +++ b/connectivity/source/drivers/ado/AGroup.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AGroup.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: oj $ $Date: 2001-05-04 09:58:41 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -90,10 +90,10 @@ #ifndef _CONNECTIVITY_ADO_BCONNECTION_HXX_ #include "ado/AConnection.hxx" #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE ado -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" +#ifndef CONNECTIVITY_CONNECTION_HXX +#include "TConnection.hxx" #endif + using namespace connectivity::ado; using namespace com::sun::star::uno; using namespace com::sun::star::lang; diff --git a/connectivity/source/drivers/ado/AGroups.cxx b/connectivity/source/drivers/ado/AGroups.cxx index 354580f7e2eb..63a835402253 100644 --- a/connectivity/source/drivers/ado/AGroups.cxx +++ b/connectivity/source/drivers/ado/AGroups.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AGroups.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: oj $ $Date: 2001-03-30 14:07:20 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,6 +77,10 @@ #ifndef _CONNECTIVITY_SDBCX_IREFRESHABLE_HXX_ #include "connectivity/sdbcx/IRefreshable.hxx" #endif +#ifndef CONNECTIVITY_CONNECTION_HXX +#include "TConnection.hxx" +#endif + using namespace connectivity::ado; using namespace com::sun::star::uno; diff --git a/connectivity/source/drivers/ado/AIndex.cxx b/connectivity/source/drivers/ado/AIndex.cxx index ce93fe8d27d9..4582db03ff4f 100644 --- a/connectivity/source/drivers/ado/AIndex.cxx +++ b/connectivity/source/drivers/ado/AIndex.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AIndex.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: oj $ $Date: 2001-05-04 09:58:41 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,13 +77,12 @@ #ifndef _CONNECTIVITY_ADO_COLUMNS_HXX_ #include "ado/AColumns.hxx" #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE ado -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" -#endif #ifndef _COMPHELPER_EXTRACT_HXX_ #include <comphelper/extract.hxx> #endif +#ifndef CONNECTIVITY_CONNECTION_HXX +#include "TConnection.hxx" +#endif using namespace connectivity::ado; using namespace com::sun::star::uno; diff --git a/connectivity/source/drivers/ado/AIndexes.cxx b/connectivity/source/drivers/ado/AIndexes.cxx index 9f8baa47ab91..8115897e2af4 100644 --- a/connectivity/source/drivers/ado/AIndexes.cxx +++ b/connectivity/source/drivers/ado/AIndexes.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AIndexes.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: oj $ $Date: 2001-04-12 12:31:30 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -73,11 +73,12 @@ #ifndef _COM_SUN_STAR_SDBC_INDEXTYPE_HPP_ #include <com/sun/star/sdbc/IndexType.hpp> #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE ado -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" +#ifndef CONNECTIVITY_CONNECTION_HXX +#include "TConnection.hxx" #endif + +using namespace connectivity; using namespace connectivity::ado; using namespace com::sun::star::uno; using namespace com::sun::star::lang; @@ -118,10 +119,10 @@ void SAL_CALL OIndexes::appendByDescriptor( const Reference< XPropertySet >& des { OAdoIndex* pIndex = (OAdoIndex*)xTunnel->getSomething(OAdoIndex:: getUnoTunnelImplementationId()); if(pIndex) - m_pCollection->Append(OLEVariant(getString(descriptor->getPropertyValue(PROPERTY_NAME))), + m_pCollection->Append(OLEVariant(getString(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)))), OLEVariant(pIndex->getImpl())); else - throw SQLException(::rtl::OUString::createFromAscii("Could not append index!"),*this,SQLSTATE_GENERAL,1000,Any()); + throw SQLException(::rtl::OUString::createFromAscii("Could not append index!"),*this,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); } OCollection_TYPE::appendByDescriptor(descriptor); diff --git a/connectivity/source/drivers/ado/AKey.cxx b/connectivity/source/drivers/ado/AKey.cxx index b5a33c6903bf..163bc9c5d162 100644 --- a/connectivity/source/drivers/ado/AKey.cxx +++ b/connectivity/source/drivers/ado/AKey.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AKey.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: oj $ $Date: 2001-05-04 09:58:41 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,10 +83,10 @@ #ifndef _CONNECTIVITY_ADO_COLUMNS_HXX_ #include "ado/AColumns.hxx" #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE ado -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" +#ifndef CONNECTIVITY_CONNECTION_HXX +#include "TConnection.hxx" #endif + using namespace connectivity::ado; using namespace com::sun::star::uno; using namespace com::sun::star::lang; diff --git a/connectivity/source/drivers/ado/AKeyColumn.cxx b/connectivity/source/drivers/ado/AKeyColumn.cxx index 2ed8f753acec..23ad5ef5dbae 100644 --- a/connectivity/source/drivers/ado/AKeyColumn.cxx +++ b/connectivity/source/drivers/ado/AKeyColumn.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AKeyColumn.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:14:20 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -92,10 +92,11 @@ OKeyColumn::OKeyColumn( const ::rtl::OUString& _ReferencedColumn, { construct(); } + // ------------------------------------------------------------------------- void OKeyColumn::construct() { sal_Int32 nAttrib = isNew() ? 0 : starbeans::PropertyAttribute::READONLY; - registerProperty(PROPERTY_REFERENCEDCOLUMN, PROPERTY_ID_REFERENCEDCOLUMN, nAttrib,&m_ReferencedColumn, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL))); + registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REFERENCEDCOLUMN), PROPERTY_ID_REFERENCEDCOLUMN, nAttrib,&m_ReferencedColumn, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL))); } diff --git a/connectivity/source/drivers/ado/AKeys.cxx b/connectivity/source/drivers/ado/AKeys.cxx index f59de10e8205..9536b828c8f9 100644 --- a/connectivity/source/drivers/ado/AKeys.cxx +++ b/connectivity/source/drivers/ado/AKeys.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AKeys.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: oj $ $Date: 2001-04-12 12:31:30 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,10 +77,12 @@ #ifndef _COM_SUN_STAR_SDBC_KEYRULE_HPP_ #include <com/sun/star/sdbc/KeyRule.hpp> #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE ado -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" +#ifndef CONNECTIVITY_CONNECTION_HXX +#include "TConnection.hxx" #endif + + +using namespace connectivity; using namespace connectivity::ado; using namespace com::sun::star::uno; using namespace com::sun::star::lang; @@ -127,10 +129,10 @@ void SAL_CALL OKeys::appendByDescriptor( const Reference< XPropertySet >& descri vOptional.vt = VT_ERROR; vOptional.scode = DISP_E_PARAMNOTFOUND; - m_pCollection->Append(OLEVariant(pKey->getImpl()),(KeyTypeEnum)getINT32(descriptor->getPropertyValue(PROPERTY_TYPE)),vOptional); + m_pCollection->Append(OLEVariant(pKey->getImpl()),(KeyTypeEnum)getINT32(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))),vOptional); } else - throw SQLException(::rtl::OUString::createFromAscii("Could not append key!"),*this,SQLSTATE_GENERAL,1000,Any()); + throw SQLException(::rtl::OUString::createFromAscii("Could not append key!"),*this,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); } OCollection_TYPE::appendByDescriptor(descriptor); diff --git a/connectivity/source/drivers/ado/APreparedStatement.cxx b/connectivity/source/drivers/ado/APreparedStatement.cxx index c71315979f66..6ddaa52c2769 100644 --- a/connectivity/source/drivers/ado/APreparedStatement.cxx +++ b/connectivity/source/drivers/ado/APreparedStatement.cxx @@ -2,9 +2,9 @@ * * $RCSfile: APreparedStatement.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: oj $ $Date: 2001-04-30 10:11:26 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -79,6 +79,9 @@ #ifndef _COMPHELPER_SEQUENCE_HXX_ #include <comphelper/sequence.hxx> #endif +#ifndef _DBHELPER_DBEXCEPTION_HXX_ +#include "connectivity/dbexception.hxx" +#endif #define CHECK_RETURN(x) \ if(!x) \ diff --git a/connectivity/source/drivers/ado/AResultSet.cxx b/connectivity/source/drivers/ado/AResultSet.cxx index e94b69877253..43fb0534c0b4 100644 --- a/connectivity/source/drivers/ado/AResultSet.cxx +++ b/connectivity/source/drivers/ado/AResultSet.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AResultSet.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: oj $ $Date: 2001-04-30 10:11:26 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,10 +63,6 @@ #ifndef _CONNECTIVITY_ADO_ARESULTSET_HXX_ #include "ado/AResultSet.hxx" #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE ado -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" -#endif #ifndef _CONNECTIVITY_ADO_ARESULTSETMETADATA_HXX_ #include "ado/AResultSetMetaData.hxx" #endif @@ -106,8 +102,8 @@ #ifndef _COMPHELPER_SEQSTREAM_HXX #include <comphelper/seqstream.hxx> #endif -#ifndef _COMPHELPER_SEQSTREAM_HXX -#include <comphelper/seqstream.hxx> +#ifndef _DBHELPER_DBEXCEPTION_HXX_ +#include "connectivity/dbexception.hxx" #endif diff --git a/connectivity/source/drivers/ado/AResultSetMetaData.cxx b/connectivity/source/drivers/ado/AResultSetMetaData.cxx index d9580947c215..2e2ed7ad5f53 100644 --- a/connectivity/source/drivers/ado/AResultSetMetaData.cxx +++ b/connectivity/source/drivers/ado/AResultSetMetaData.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AResultSetMetaData.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oj $ $Date: 2001-04-12 12:31:30 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,9 +72,8 @@ #ifndef _CONNECTIVITY_ADO_AWRAPADO_HXX_ #include "ado/Awrapado.hxx" #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE ado -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" +#ifndef _DBHELPER_DBEXCEPTION_HXX_ +#include "connectivity/dbexception.hxx" #endif using namespace connectivity; diff --git a/connectivity/source/drivers/ado/AStatement.cxx b/connectivity/source/drivers/ado/AStatement.cxx index 0a9a74dfaf7d..adce16cb9088 100644 --- a/connectivity/source/drivers/ado/AStatement.cxx +++ b/connectivity/source/drivers/ado/AStatement.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AStatement.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: oj $ $Date: 2001-04-30 10:11:26 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,10 +67,6 @@ #ifndef _CONNECTIVITY_ADO_ARESULTSET_HXX_ #include "ado/AResultSet.hxx" #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE ado -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" -#endif #ifndef _COMPHELPER_PROPERTY_HXX_ #include <comphelper/property.hxx> #endif @@ -104,17 +100,6 @@ ADOS::ThrowException(*m_pConnection->getConnection(),*this); -// define the properties of this lib -// this file includes the properties for this dll -namespace connectivity -{ - namespace ado - { -#ifndef CONNECTIVITY_USTRINGDESCRIPTION_IMPL_HXX -#include "UStringDescription_Impl.hxx" -#endif - } -} using namespace connectivity::ado; diff --git a/connectivity/source/drivers/ado/ATable.cxx b/connectivity/source/drivers/ado/ATable.cxx index 1064aaba3d5f..34a2a42d3b46 100644 --- a/connectivity/source/drivers/ado/ATable.cxx +++ b/connectivity/source/drivers/ado/ATable.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ATable.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: oj $ $Date: 2001-05-04 09:58:41 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -101,10 +101,11 @@ #ifndef _COMPHELPER_SEQUENCE_HXX_ #include <comphelper/sequence.hxx> #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE ado -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" +#ifndef CONNECTIVITY_CONNECTION_HXX +#include "TConnection.hxx" #endif + +using namespace connectivity; using namespace connectivity::ado; using namespace com::sun::star::uno; using namespace com::sun::star::lang; @@ -289,7 +290,7 @@ void SAL_CALL OAdoTable::alterColumnByName( const ::rtl::OUString& colName, cons m_aTable.get_Columns()->Append(OLEVariant(pColumn->getColumnImpl())); } else - throw SQLException(::rtl::OUString::createFromAscii("Could not alter column by name!"),*this,SQLSTATE_GENERAL,1000,Any()); + throw SQLException(::rtl::OUString::createFromAscii("Could not alter column by name!"),*this,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); } m_pColumns->refresh(); @@ -312,7 +313,7 @@ void SAL_CALL OAdoTable::alterColumnByIndex( sal_Int32 index, const Reference< X m_aTable.get_Columns()->Append(OLEVariant(pColumn->getColumnImpl())); } else - throw SQLException(::rtl::OUString::createFromAscii("Could not alter column by index!"),*this,SQLSTATE_GENERAL,1000,Any()); + throw SQLException(::rtl::OUString::createFromAscii("Could not alter column by index!"),*this,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); } m_pColumns->refresh(); } diff --git a/connectivity/source/drivers/ado/ATables.cxx b/connectivity/source/drivers/ado/ATables.cxx index 0720065db007..8cf847b7668e 100644 --- a/connectivity/source/drivers/ado/ATables.cxx +++ b/connectivity/source/drivers/ado/ATables.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ATables.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: oj $ $Date: 2001-04-27 11:38:25 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -89,11 +89,11 @@ #ifndef _CONNECTIVITY_ADO_AWRAPADO_HXX_ #include "ado/Awrapado.hxx" #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE ado -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" +#ifndef CONNECTIVITY_CONNECTION_HXX +#include "TConnection.hxx" #endif +using namespace connectivity; using namespace connectivity::ado; using namespace com::sun::star::uno; using namespace com::sun::star::lang; @@ -140,7 +140,7 @@ void SAL_CALL OTables::appendByDescriptor( const Reference< XPropertySet >& desc ADOS::ThrowException(*m_pCatalog->getConnection()->getConnection(),*this); } else - throw SQLException(::rtl::OUString::createFromAscii("Could not append table!"),*this,SQLSTATE_GENERAL,1000,Any()); + throw SQLException(::rtl::OUString::createFromAscii("Could not append table!"),*this,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); } OCollection_TYPE::appendByDescriptor(descriptor); diff --git a/connectivity/source/drivers/ado/AUser.cxx b/connectivity/source/drivers/ado/AUser.cxx index fcab27da4889..3b7cdc16e830 100644 --- a/connectivity/source/drivers/ado/AUser.cxx +++ b/connectivity/source/drivers/ado/AUser.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AUser.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: oj $ $Date: 2001-05-04 09:58:41 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -80,10 +80,6 @@ #ifndef _CONNECTIVITY_ADO_BCONNECTION_HXX_ #include "ado/AConnection.hxx" #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE ado -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" -#endif using namespace connectivity::ado; using namespace com::sun::star::uno; @@ -225,11 +221,12 @@ OUserExtend::OUserExtend(sal_Bool _bCase, ADOUser* _pUser) : OAdoUser(_bCase,_ OUserExtend::OUserExtend(sal_Bool _bCase, const ::rtl::OUString& _Name) : OAdoUser(_bCase,_Name) { } + // ------------------------------------------------------------------------- void OUserExtend::construct() { OUser_TYPEDEF::construct(); - registerProperty(PROPERTY_PASSWORD, PROPERTY_ID_PASSWORD,0,&m_Password,::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL))); + registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD), PROPERTY_ID_PASSWORD,0,&m_Password,::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL))); } // ----------------------------------------------------------------------------- cppu::IPropertyArrayHelper* OUserExtend::createArrayHelper() const diff --git a/connectivity/source/drivers/ado/AView.cxx b/connectivity/source/drivers/ado/AView.cxx index 53739893103e..8c5a49a38a8f 100644 --- a/connectivity/source/drivers/ado/AView.cxx +++ b/connectivity/source/drivers/ado/AView.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AView.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: oj $ $Date: 2001-04-30 10:11:26 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,10 +64,6 @@ #ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_ #include <com/sun/star/lang/DisposedException.hpp> #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE ado -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" -#endif #ifndef _CONNECTIVITY_ADO_ADOIMP_HXX_ #include "ado/adoimp.hxx" #endif @@ -80,6 +76,9 @@ #ifndef _COMPHELPER_SEQUENCE_HXX_ #include <comphelper/sequence.hxx> #endif +#ifndef CONNECTIVITY_CONNECTION_HXX +#include "TConnection.hxx" +#endif // ------------------------------------------------------------------------- using namespace connectivity::ado; diff --git a/connectivity/source/drivers/ado/AViews.cxx b/connectivity/source/drivers/ado/AViews.cxx index 2cfc89f9436d..6fa4ba273539 100644 --- a/connectivity/source/drivers/ado/AViews.cxx +++ b/connectivity/source/drivers/ado/AViews.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AViews.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: oj $ $Date: 2001-04-27 11:38:25 $ + * last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -85,14 +85,14 @@ #ifndef _CONNECTIVITY_ADO_BCONNECTION_HXX_ #include "ado/AConnection.hxx" #endif -#define CONNECTIVITY_PROPERTY_NAME_SPACE ado -#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ -#include "propertyids.hxx" -#endif #ifndef _CONNECTIVITY_ADO_AWRAPADO_HXX_ #include "ado/Awrapado.hxx" #endif +#ifndef CONNECTIVITY_CONNECTION_HXX +#include "TConnection.hxx" +#endif +using namespace connectivity; using namespace connectivity::ado; using namespace com::sun::star::uno; using namespace com::sun::star::lang; @@ -122,6 +122,7 @@ Reference< XPropertySet > OViews::createEmptyObject() OAdoView* pNew = new OAdoView(isCaseSensitive()); return pNew; } + // ------------------------------------------------------------------------- // XAppend void SAL_CALL OViews::appendByDescriptor( const Reference< XPropertySet >& descriptor ) throw(SQLException, ElementExistException, RuntimeException) @@ -134,11 +135,11 @@ void SAL_CALL OViews::appendByDescriptor( const Reference< XPropertySet >& descr OAdoView* pView = (OAdoView*)xTunnel->getSomething(OAdoView:: getUnoTunnelImplementationId()); if(pView) { - m_pCollection->Append(OLEString(getString(descriptor->getPropertyValue(PROPERTY_NAME))),(IDispatch *)pView->getImpl()); + m_pCollection->Append(OLEString(getString(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)))),(IDispatch *)pView->getImpl()); ADOS::ThrowException(*m_pCatalog->getConnection()->getConnection(),*this); } else - throw SQLException(::rtl::OUString::createFromAscii("Could not append view!"),*this,SQLSTATE_GENERAL,1000,Any()); + throw SQLException(::rtl::OUString::createFromAscii("Could not append view!"),*this,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); } OCollection_TYPE::appendByDescriptor(descriptor); diff --git a/connectivity/source/drivers/ado/Awrapado.cxx b/connectivity/source/drivers/ado/Awrapado.cxx new file mode 100644 index 000000000000..bc91fa2c2530 --- /dev/null +++ b/connectivity/source/drivers/ado/Awrapado.cxx @@ -0,0 +1,894 @@ +/************************************************************************* + * + * $RCSfile: Awrapado.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: oj $ $Date: 2001-05-14 11:42:44 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the License); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CONNECTIVITY_ADO_AWRAPADO_HXX_ +#include "ado/Awrapado.hxx" +#endif + +using namespace connectivity::ado; + +ADOProperties* WpADOConnection::get_Properties() const +{ + ADOProperties* pProps=NULL; + pInterface->get_Properties(&pProps); + return pProps; +} + +rtl::OUString WpADOConnection::GetConnectionString() const +{ + OLEString aBSTR; + pInterface->get_ConnectionString(&aBSTR); + return aBSTR; +} + +sal_Bool WpADOConnection::PutConnectionString(const ::rtl::OUString &aCon) const +{ + OLEString bstr(aCon); + sal_Bool bErg = SUCCEEDED(pInterface->put_ConnectionString(bstr)); + + return bErg; +} + +sal_Int32 WpADOConnection::GetCommandTimeout() const +{ + sal_Int32 nRet=0; + pInterface->get_CommandTimeout(&nRet); + return nRet; +} + +void WpADOConnection::PutCommandTimeout(sal_Int32 nRet) +{ + pInterface->put_CommandTimeout(nRet); +} + +sal_Int32 WpADOConnection::GetConnectionTimeout() const +{ + sal_Int32 nRet=0; + pInterface->get_ConnectionTimeout(&nRet); + return nRet; +} + +void WpADOConnection::PutConnectionTimeout(sal_Int32 nRet) +{ + pInterface->put_ConnectionTimeout(nRet); +} + +sal_Bool WpADOConnection::Close( ) +{ + return (SUCCEEDED(pInterface->Close())); +} + +sal_Bool WpADOConnection::Execute(const ::rtl::OUString& _CommandText,OLEVariant& RecordsAffected,long Options, WpADORecordset** ppiRset) +{ + OLEString sStr1(_CommandText); + sal_Bool bErg = SUCCEEDED(pInterface->Execute(sStr1,&RecordsAffected,Options,(_ADORecordset**)ppiRset)); + return bErg; +} + +sal_Bool WpADOConnection::BeginTrans() +{ + sal_Int32 nIso=0; + return SUCCEEDED(pInterface->BeginTrans(&nIso)); +} + +sal_Bool WpADOConnection::CommitTrans( ) +{ + return SUCCEEDED(pInterface->CommitTrans()); +} + +sal_Bool WpADOConnection::RollbackTrans( ) +{ + return SUCCEEDED(pInterface->RollbackTrans()); +} + +sal_Bool WpADOConnection::Open(const ::rtl::OUString& ConnectionString, const ::rtl::OUString& UserID,const ::rtl::OUString& Password,long Options) +{ + OLEString sStr1(ConnectionString); + OLEString sStr2(UserID); + OLEString sStr3(Password); + sal_Bool bErg = SUCCEEDED(pInterface->Open(sStr1,sStr2,sStr3,Options)); + return bErg; +} + +sal_Bool WpADOConnection::GetErrors(ADOErrors** pErrors) +{ + return SUCCEEDED(pInterface->get_Errors(pErrors)); +} + +::rtl::OUString WpADOConnection::GetDefaultDatabase() const +{ + OLEString aBSTR; pInterface->get_DefaultDatabase(&aBSTR); + return aBSTR; +} + +sal_Bool WpADOConnection::PutDefaultDatabase(const ::rtl::OUString& _bstr) +{ + OLEString bstr(_bstr); + sal_Bool bErg = SUCCEEDED(pInterface->put_DefaultDatabase(bstr)); + + return bErg; +} + +IsolationLevelEnum WpADOConnection::get_IsolationLevel() const +{ + IsolationLevelEnum eNum=adXactUnspecified; + pInterface->get_IsolationLevel(&eNum); + return eNum; +} + +sal_Bool WpADOConnection::put_IsolationLevel(const IsolationLevelEnum& eNum) +{ + return SUCCEEDED(pInterface->put_IsolationLevel(eNum)); +} + +sal_Int32 WpADOConnection::get_Attributes() const +{ + sal_Int32 nRet=0; + pInterface->get_Attributes(&nRet); + return nRet; +} + +sal_Bool WpADOConnection::put_Attributes(sal_Int32 nRet) +{ + return SUCCEEDED(pInterface->put_Attributes(nRet)); +} + +CursorLocationEnum WpADOConnection::get_CursorLocation() const +{ + CursorLocationEnum eNum=adUseNone; + pInterface->get_CursorLocation(&eNum); + return eNum; +} + +sal_Bool WpADOConnection::put_CursorLocation(const CursorLocationEnum &eNum) +{ + return SUCCEEDED(pInterface->put_CursorLocation(eNum)); +} + +ConnectModeEnum WpADOConnection::get_Mode() const +{ + ConnectModeEnum eNum=adModeUnknown; + pInterface->get_Mode(&eNum); + return eNum; +} + +sal_Bool WpADOConnection::put_Mode(const ConnectModeEnum &eNum) +{ + + return SUCCEEDED(pInterface->put_Mode(eNum)); +} + +::rtl::OUString WpADOConnection::get_Provider() const +{ + OLEString aBSTR; pInterface->get_Provider(&aBSTR); + return aBSTR; +} + +sal_Bool WpADOConnection::put_Provider(const ::rtl::OUString& _bstr) +{ + OLEString bstr(_bstr); + return SUCCEEDED(pInterface->put_Provider(bstr)); +} + +sal_Int32 WpADOConnection::get_State() const +{ + sal_Int32 nRet=0; + pInterface->get_State(&nRet); + return nRet; +} + +sal_Bool WpADOConnection::OpenSchema(SchemaEnum eNum,OLEVariant& Restrictions,OLEVariant& SchemaID,ADORecordset**pprset) +{ + return SUCCEEDED(pInterface->OpenSchema(eNum,Restrictions,SchemaID,pprset)); +} + +::rtl::OUString WpADOConnection::get_Version() const +{ + OLEString aBSTR; + pInterface->get_Version(&aBSTR); + return aBSTR; +} + +sal_Bool WpADOCommand::putref_ActiveConnection( WpADOConnection *pCon) +{ + return SUCCEEDED(pInterface->putref_ActiveConnection(pCon->pInterface)); +} + +void WpADOCommand::put_ActiveConnection(/* [in] */ const OLEVariant& vConn) +{ + pInterface->put_ActiveConnection(vConn); +} + +void WpADOCommand::Create() +{ + IClassFactory2* pIUnknown = NULL; + IUnknown *pOuter = NULL; + HRESULT hr; + hr = CoGetClassObject( ADOS::CLSID_ADOCOMMAND_21, + CLSCTX_INPROC_SERVER, + NULL, + IID_IClassFactory2, + (void**)&pIUnknown ); + + if( !FAILED( hr ) ) + { + pIUnknown->AddRef(); + ADOCommand* pCommand=NULL; + + hr = pIUnknown->CreateInstanceLic( pOuter, + NULL, + ADOS::IID_ADOCOMMAND_21, + ADOS::GetKeyStr(), + (void**) &pCommand); + + if( !FAILED( hr ) ) + { + pInterface = pCommand; + pInterface->AddRef(); + } + pIUnknown->Release(); + } +} + +sal_Int32 WpADOCommand::get_State() const +{ + sal_Int32 nRet=0; + pInterface->get_State(&nRet); + return nRet; +} + +::rtl::OUString WpADOCommand::get_CommandText() const +{ + OLEString aBSTR; pInterface->get_CommandText(&aBSTR); + return aBSTR; +} + +sal_Bool WpADOCommand::put_CommandText(const ::rtl::OUString &aCon) +{ + OLEString bstr(aCon); + sal_Bool bErg = SUCCEEDED(pInterface->put_CommandText(bstr)); + + return bErg; +} + +sal_Int32 WpADOCommand::get_CommandTimeout() const +{ + sal_Int32 nRet=0; + pInterface->get_CommandTimeout(&nRet); + return nRet; +} + +void WpADOCommand::put_CommandTimeout(sal_Int32 nRet) +{ + pInterface->put_CommandTimeout(nRet); +} + +sal_Bool WpADOCommand::get_Prepared() const +{ + VARIANT_BOOL bPrepared = VARIANT_FALSE; + pInterface->get_Prepared(&bPrepared); + return bPrepared == VARIANT_TRUE; +} + +sal_Bool WpADOCommand::put_Prepared(VARIANT_BOOL bPrepared) const +{ + return SUCCEEDED(pInterface->put_Prepared(bPrepared)); +} + +sal_Bool WpADOCommand::Execute(OLEVariant& RecordsAffected,OLEVariant& Parameters,long Options, ADORecordset** ppiRset) +{ + return SUCCEEDED(pInterface->Execute(&RecordsAffected,&Parameters,Options,ppiRset)); +} + +ADOParameter* WpADOCommand::CreateParameter(const ::rtl::OUString &_bstr,DataTypeEnum Type,ParameterDirectionEnum Direction,long nSize,const OLEVariant &Value) +{ + ADOParameter* pPara = NULL; + OLEString bstr(_bstr); + sal_Bool bErg = SUCCEEDED(pInterface->CreateParameter(bstr,Type,Direction,nSize,Value,&pPara)); + + return bErg ? pPara : NULL; +} + +ADOParameters* WpADOCommand::get_Parameters() const +{ + ADOParameters* pPara=NULL; + pInterface->get_Parameters(&pPara); + return pPara; +} + +sal_Bool WpADOCommand::put_CommandType( /* [in] */ CommandTypeEnum lCmdType) +{ + return SUCCEEDED(pInterface->put_CommandType(lCmdType)); +} + +CommandTypeEnum WpADOCommand::get_CommandType( ) const +{ + CommandTypeEnum eNum=adCmdUnspecified; + pInterface->get_CommandType(&eNum); + return eNum; +} + +// gibt den Namen des Feldes zur"ueck +::rtl::OUString WpADOCommand::GetName() const +{ + OLEString aBSTR; + pInterface->get_Name(&aBSTR); + return aBSTR; +} + +sal_Bool WpADOCommand::put_Name(const ::rtl::OUString& _Name) +{ + OLEString bstr(_Name); + sal_Bool bErg = SUCCEEDED(pInterface->put_Name(bstr)); + + return bErg; +} +sal_Bool WpADOCommand::Cancel() +{ + return SUCCEEDED(pInterface->Cancel()); +} + +::rtl::OUString WpADOError::GetDescription() const +{ + OLEString aBSTR; + pInterface->get_Description(&aBSTR); + return aBSTR; +} + + ::rtl::OUString WpADOError::GetSource() const +{ + OLEString aBSTR; + pInterface->get_Source(&aBSTR); + return aBSTR; +} + + sal_Int32 WpADOError::GetNumber() const +{ + sal_Int32 nErrNr=0; + pInterface->get_Number(&nErrNr); + return nErrNr; +} + + ::rtl::OUString WpADOError::GetSQLState() const +{ + OLEString aBSTR; + pInterface->get_SQLState(&aBSTR); + return aBSTR; +} + + sal_Int32 WpADOError::GetNativeError() const +{ + sal_Int32 nErrNr=0; + pInterface->get_NativeError(&nErrNr); + return nErrNr; +} + ADOProperties* WpADOField::get_Properties() +{ + ADOProperties* pProps = NULL; + pInterface->get_Properties(&pProps); + return pProps; +} + + sal_Int32 WpADOField::GetActualSize() const +{ + sal_Int32 nActualSize=0; + pInterface->get_ActualSize(&nActualSize); + return nActualSize; +} + + sal_Int32 WpADOField::GetAttributes() const +{ + sal_Int32 eADOSFieldAttributes=0; + pInterface->get_Attributes(&eADOSFieldAttributes); + return eADOSFieldAttributes; +} + + sal_Int32 WpADOField::GetStatus() const +{ + sal_Int32 eADOSFieldAttributes=0; + // pInterface->get_Status(&eADOSFieldAttributes); + return eADOSFieldAttributes; +} + + sal_Int32 WpADOField::GetDefinedSize() const +{ + sal_Int32 nDefinedSize=0; + pInterface->get_DefinedSize(&nDefinedSize); + return nDefinedSize; +} + +// gibt den Namen des Feldes zur"ueck + ::rtl::OUString WpADOField::GetName() const +{ + OLEString aBSTR; + pInterface->get_Name(&aBSTR); + return aBSTR; +} + + DataTypeEnum WpADOField::GetADOType() const +{ + DataTypeEnum eType=adEmpty; + pInterface->get_Type(&eType); + return eType; +} + + void WpADOField::get_Value(OLEVariant& aValVar) const +{ + aValVar.setEmpty(); + pInterface->get_Value(&aValVar); +} + + OLEVariant WpADOField::get_Value() const +{ + OLEVariant aValVar; + pInterface->get_Value(&aValVar); + return aValVar; +} + + sal_Bool WpADOField::PutValue(const OLEVariant& aVariant) +{ + return (SUCCEEDED(pInterface->put_Value(aVariant))); +} + + sal_Int32 WpADOField::GetPrecision() const +{ + sal_uInt8 eType=0; + pInterface->get_Precision(&eType); + return eType; +} + + sal_Int32 WpADOField::GetNumericScale() const +{ + sal_uInt8 eType=0; + pInterface->get_NumericScale(&eType); + return eType; +} + + sal_Bool WpADOField::AppendChunk(const OLEVariant& _Variant) +{ + return (SUCCEEDED(pInterface->AppendChunk(_Variant))); +} + + OLEVariant WpADOField::GetChunk(long Length) const +{ + OLEVariant aValVar; + pInterface->GetChunk(Length,&aValVar); + return aValVar; +} + + void WpADOField::GetChunk(long Length,OLEVariant &aValVar) const +{ + pInterface->GetChunk(Length,&aValVar); +} + + OLEVariant WpADOField::GetOriginalValue() const +{ + OLEVariant aValVar; + pInterface->get_OriginalValue(&aValVar); + return aValVar; +} + + void WpADOField::GetOriginalValue(OLEVariant &aValVar) const +{ + pInterface->get_OriginalValue(&aValVar); +} + + OLEVariant WpADOField::GetUnderlyingValue() const +{ + OLEVariant aValVar; + pInterface->get_UnderlyingValue(&aValVar); + return aValVar; +} + + void WpADOField::GetUnderlyingValue(OLEVariant &aValVar) const +{ + pInterface->get_UnderlyingValue(&aValVar); +} + + sal_Bool WpADOField::PutPrecision(sal_Int8 _prec) +{ + return (SUCCEEDED(pInterface->put_Precision(_prec))); +} + + sal_Bool WpADOField::PutNumericScale(sal_Int8 _prec) +{ + return (SUCCEEDED(pInterface->put_NumericScale(_prec))); +} + + void WpADOField::PutADOType(DataTypeEnum eType) +{ + pInterface->put_Type(eType); +} + + sal_Bool WpADOField::PutDefinedSize(sal_Int32 _nDefSize) +{ + return (SUCCEEDED(pInterface->put_DefinedSize(_nDefSize))); +} + + sal_Bool WpADOField::PutAttributes(sal_Int32 _nDefSize) +{ + return (SUCCEEDED(pInterface->put_Attributes(_nDefSize))); +} + + OLEVariant WpADOProperty::GetValue() const +{ + OLEVariant aValVar; + pInterface->get_Value(&aValVar); + return aValVar; +} + + void WpADOProperty::GetValue(OLEVariant &aValVar) const +{ + pInterface->get_Value(&aValVar); +} + + sal_Bool WpADOProperty::PutValue(const OLEVariant &aValVar) +{ + return (SUCCEEDED(pInterface->put_Value(aValVar))); +} + + ::rtl::OUString WpADOProperty::GetName() const +{ + OLEString aBSTR; + pInterface->get_Name(&aBSTR); + return aBSTR; +} + + DataTypeEnum WpADOProperty::GetADOType() const +{ + DataTypeEnum eType=adEmpty; + pInterface->get_Type(&eType); + return eType; +} + + sal_Int32 WpADOProperty::GetAttributes() const +{ + sal_Int32 eADOSFieldAttributes=0; + pInterface->get_Attributes(&eADOSFieldAttributes); + return eADOSFieldAttributes; +} + + sal_Bool WpADOProperty::PutAttributes(sal_Int32 _nDefSize) +{ + return (SUCCEEDED(pInterface->put_Attributes(_nDefSize))); +} + void WpADORecordset::Create() +{ + IClassFactory2* pIUnknown = NULL; + IUnknown *pOuter = NULL; + HRESULT hr; + hr = CoGetClassObject( ADOS::CLSID_ADORECORDSET_21, + CLSCTX_INPROC_SERVER, + NULL, + IID_IClassFactory2, + (void**)&pIUnknown ); + + if( !FAILED( hr ) ) + { + pIUnknown->AddRef(); + + ADORecordset *pRec = NULL; + hr = pIUnknown->CreateInstanceLic( pOuter, + NULL, + ADOS::IID_ADORECORDSET_21, + ADOS::GetKeyStr(), + (void**) &pRec); + + if( !FAILED( hr ) ) + { + pInterface = pRec; + pInterface->AddRef(); + } + pIUnknown->Release(); + } +} + + sal_Bool WpADORecordset::Open( + /* [optional][in] */ VARIANT Source, + /* [optional][in] */ VARIANT ActiveConnection, + /* [defaultvalue][in] */ CursorTypeEnum CursorType, + /* [defaultvalue][in] */ LockTypeEnum LockType, + /* [defaultvalue][in] */ sal_Int32 Options) +{ + return (SUCCEEDED(pInterface->Open(Source,ActiveConnection,CursorType,LockType,Options))); +} + + + LockTypeEnum WpADORecordset::GetLockType() +{ + LockTypeEnum eType=adLockUnspecified; + pInterface->get_LockType(&eType); + return eType; +} + + void WpADORecordset::Close() +{ + pInterface->Close(); +} + + sal_Bool WpADORecordset::Cancel() const +{ + return (SUCCEEDED(pInterface->Cancel())); +} + + sal_Int32 WpADORecordset::get_State( ) +{ + sal_Int32 nState = 0; + pInterface->get_State(&nState); + return nState; +} + + sal_Bool WpADORecordset::Supports( /* [in] */ CursorOptionEnum CursorOptions) +{ + VARIANT_BOOL bSupports=VARIANT_FALSE; + pInterface->Supports(CursorOptions,&bSupports); + return bSupports == VARIANT_TRUE; +} + +PositionEnum WpADORecordset::get_AbsolutePosition() +{ + PositionEnum aTemp=adPosUnknown; + pInterface->get_AbsolutePosition(&aTemp); + return aTemp; +} + + void WpADORecordset::GetDataSource(IUnknown** pIUnknown) const +{ + pInterface->get_DataSource(pIUnknown); +} + + void WpADORecordset::PutRefDataSource(IUnknown* pIUnknown) +{ + pInterface->putref_DataSource(pIUnknown); +} + + void WpADORecordset::GetBookmark(VARIANT& var) +{ + pInterface->get_Bookmark(&var); +} + + OLEVariant WpADORecordset::GetBookmark() +{ + OLEVariant var; + pInterface->get_Bookmark(&var); + return var; +} + +CompareEnum WpADORecordset::CompareBookmarks(const OLEVariant& left,const OLEVariant& right) +{ + CompareEnum eNum=adCompareNotComparable; + pInterface->CompareBookmarks(left,right,&eNum); + return eNum; +} + + sal_Bool WpADORecordset::SetBookmark(const OLEVariant &pSafeAr) +{ + return SUCCEEDED(pInterface->put_Bookmark(pSafeAr)); +} + + + ADOFields* WpADORecordset::GetFields() const +{ + ADOFields* pFields=NULL; + pInterface->get_Fields(&pFields); + return pFields; +} + + + sal_Bool WpADORecordset::Move(sal_Int32 nRows, VARIANT aBmk) {return SUCCEEDED(pInterface->Move(nRows, aBmk));} + sal_Bool WpADORecordset::MoveNext() {return SUCCEEDED(pInterface->MoveNext());} + sal_Bool WpADORecordset::MovePrevious() {return SUCCEEDED(pInterface->MovePrevious());} + sal_Bool WpADORecordset::MoveFirst() {return SUCCEEDED(pInterface->MoveFirst());} + sal_Bool WpADORecordset::MoveLast() {return SUCCEEDED(pInterface->MoveLast());} + + sal_Bool WpADORecordset::IsAtBOF() const +{ + VARIANT_BOOL bIsAtBOF=VARIANT_FALSE; + pInterface->get_BOF(&bIsAtBOF); + return bIsAtBOF == VARIANT_TRUE; +} + + sal_Bool WpADORecordset::IsAtEOF() const +{ + VARIANT_BOOL bIsAtEOF=VARIANT_FALSE; + pInterface->get_EOF(&bIsAtEOF); + return bIsAtEOF == VARIANT_TRUE; +} + + sal_Bool WpADORecordset::Delete(AffectEnum eNum) +{ + return SUCCEEDED(pInterface->Delete(eNum)); +} + + sal_Bool WpADORecordset::AddNew(const OLEVariant &FieldList,const OLEVariant &Values) +{ + return SUCCEEDED(pInterface->AddNew(FieldList,Values)); +} + + sal_Bool WpADORecordset::Update(const OLEVariant &FieldList,const OLEVariant &Values) +{ + return SUCCEEDED(pInterface->Update(FieldList,Values)); +} + + sal_Bool WpADORecordset::CancelUpdate() +{ + return SUCCEEDED(pInterface->CancelUpdate()); +} + + ADOProperties* WpADORecordset::get_Properties() const +{ + ADOProperties* pProps=NULL; + pInterface->get_Properties(&pProps); + return pProps; +} + + sal_Bool WpADORecordset::NextRecordset(OLEVariant& RecordsAffected,ADORecordset** ppiRset) +{ + return SUCCEEDED(pInterface->NextRecordset(&RecordsAffected,ppiRset)); +} + + sal_Bool WpADORecordset::get_RecordCount(sal_Int32 &_nRet) const +{ + return SUCCEEDED(pInterface->get_RecordCount(&_nRet)); +} + + sal_Bool WpADORecordset::get_MaxRecords(sal_Int32 &_nRet) const +{ + return SUCCEEDED(pInterface->get_MaxRecords(&_nRet)); +} + + sal_Bool WpADORecordset::put_MaxRecords(sal_Int32 _nRet) +{ + return SUCCEEDED(pInterface->put_MaxRecords(_nRet)); +} + + sal_Bool WpADORecordset::get_CursorType(CursorTypeEnum &_nRet) const +{ + return SUCCEEDED(pInterface->get_CursorType(&_nRet)); +} + + sal_Bool WpADORecordset::put_CursorType(CursorTypeEnum _nRet) +{ + return SUCCEEDED(pInterface->put_CursorType(_nRet)); +} + + sal_Bool WpADORecordset::get_LockType(LockTypeEnum &_nRet) const +{ + return SUCCEEDED(pInterface->get_LockType(&_nRet)); +} + + sal_Bool WpADORecordset::put_LockType(LockTypeEnum _nRet) +{ + return SUCCEEDED(pInterface->put_LockType(_nRet)); +} + + sal_Bool WpADORecordset::get_CacheSize(sal_Int32 &_nRet) const +{ + return SUCCEEDED(pInterface->get_CacheSize(&_nRet)); +} + + sal_Bool WpADORecordset::put_CacheSize(sal_Int32 _nRet) +{ + return SUCCEEDED(pInterface->put_CacheSize(_nRet)); +} + + sal_Bool WpADORecordset::UpdateBatch(AffectEnum AffectRecords) +{ + return SUCCEEDED(pInterface->UpdateBatch(AffectRecords)); +} + + ::rtl::OUString WpADOParameter::GetName() const +{ + OLEString aBSTR; + pInterface->get_Name(&aBSTR); + return aBSTR; +} + + DataTypeEnum WpADOParameter::GetADOType() const +{ + DataTypeEnum eType=adEmpty; + pInterface->get_Type(&eType); + return eType; +} + + sal_Int32 WpADOParameter::GetAttributes() const +{ + sal_Int32 eADOSFieldAttributes=0; + pInterface->get_Attributes(&eADOSFieldAttributes); + return eADOSFieldAttributes; +} + + sal_Int32 WpADOParameter::GetPrecision() const +{ + sal_uInt8 eType=0; + pInterface->get_Precision(&eType); + return eType; +} + + sal_Int32 WpADOParameter::GetNumericScale() const +{ + sal_uInt8 eType=0; + pInterface->get_NumericScale(&eType); + return eType; +} + + ParameterDirectionEnum WpADOParameter::get_Direction() const +{ + ParameterDirectionEnum alParmDirection=adParamUnknown; + pInterface->get_Direction(&alParmDirection); + return alParmDirection; +} + + void WpADOParameter::GetValue(OLEVariant& aValVar) const +{ + pInterface->get_Value(&aValVar); +} + + OLEVariant WpADOParameter::GetValue() const +{ + OLEVariant aValVar; + pInterface->get_Value(&aValVar); + return aValVar; +} + + sal_Bool WpADOParameter::PutValue(const OLEVariant& aVariant) +{ + return (SUCCEEDED(pInterface->put_Value(aVariant))); +} diff --git a/connectivity/source/drivers/ado/makefile.mk b/connectivity/source/drivers/ado/makefile.mk index fef8eba5cf21..2fd2f0a41efd 100644 --- a/connectivity/source/drivers/ado/makefile.mk +++ b/connectivity/source/drivers/ado/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.5 $ +# $Revision: 1.6 $ # -# last change: $Author: oj $ $Date: 2001-04-12 12:31:30 $ +# last change: $Author: oj $ $Date: 2001-05-14 11:40:04 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -80,6 +80,7 @@ ENVCFLAGS+=/FR$(SLO)$/ # --- Files ------------------------------------- SLOFILES=\ + $(SLO)$/Awrapado.obj \ $(SLO)$/ADatabaseMetaData.obj \ $(SLO)$/AColumn.obj \ $(SLO)$/AColumns.obj \ |