diff options
Diffstat (limited to 'connectivity/source/drivers')
-rw-r--r-- | connectivity/source/drivers/ado/AColumn.cxx | 40 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/AColumns.cxx | 35 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/AConnection.cxx | 105 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/ADriver.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/AIndex.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/AResultSetMetaData.cxx | 46 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/ATable.cxx | 5 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/ATables.cxx | 5 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/Awrapado.cxx | 24 |
9 files changed, 194 insertions, 80 deletions
diff --git a/connectivity/source/drivers/ado/AColumn.cxx b/connectivity/source/drivers/ado/AColumn.cxx index 8d39e48b6de7..7d09e5224601 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.19 $ + * $Revision: 1.20 $ * - * last change: $Author: oj $ $Date: 2002-07-22 10:05:53 $ + * last change: $Author: oj $ $Date: 2002-11-29 12:24:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,6 +83,9 @@ #ifndef _COMPHELPER_TYPES_HXX_ #include <comphelper/types.hxx> #endif +#ifndef _CONNECTIVITY_ADO_CATALOG_HXX_ +#include "ado/ACatalog.hxx" +#endif using namespace ::comphelper; @@ -120,6 +123,7 @@ OAdoColumn::OAdoColumn(sal_Bool _bCase,OConnection* _pConnection,_ADOColumn* _pC construct(); OSL_ENSURE(_pColumn,"Column can not be null!"); m_aColumn = WpADOColumn(_pColumn); + // m_aColumn.put_ParentCatalog(_pConnection->getAdoCatalog()->getCatalog()); fillPropertyValues(); } // ------------------------------------------------------------------------- @@ -128,8 +132,10 @@ OAdoColumn::OAdoColumn(sal_Bool _bCase,OConnection* _pConnection) ,m_pConnection(_pConnection) { m_aColumn.Create(); + m_aColumn.put_ParentCatalog(_pConnection->getAdoCatalog()->getCatalog()); construct(); fillPropertyValues(); + m_Type = DataType::OTHER; } //-------------------------------------------------------------------------- @@ -196,7 +202,19 @@ void OAdoColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& r { sal_Int32 nVal=0; rValue >>= nVal; - m_aColumn.put_Type(ADOS::MapJdbc2ADOType(nVal,m_pConnection->getEngineType())); + sal_Bool bForceTo; + const OTypeInfoMap* pTypeInfoMap = m_pConnection->getTypeInfo(); + const OExtendedTypeInfo* pTypeInfo = OConnection::getTypeInfoFromType( *m_pConnection->getTypeInfo() + ,nVal + ,m_TypeName + ,m_Precision + ,m_Scale + ,ADOS::MapJdbc2ADOType(nVal,m_pConnection->getEngineType()) + ,bForceTo); + if ( pTypeInfo ) + m_aColumn.put_Type(static_cast<DataTypeEnum>(pTypeInfo->eType)); + else + m_aColumn.put_Type(ADOS::MapJdbc2ADOType(nVal,m_pConnection->getEngineType())); } break; case PROPERTY_ID_TYPENAME: @@ -228,7 +246,7 @@ void OAdoColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& r break; case PROPERTY_ID_ISAUTOINCREMENT: - pAdoPropertyName = "Autoincrement"; + OTools::putValue( m_aColumn.get_Properties(), ::rtl::OUString::createFromAscii( "Autoincrement" ), getBOOL( rValue ) ); break; case PROPERTY_ID_DESCRIPTION: @@ -261,9 +279,9 @@ void OAdoColumn::fillPropertyValues() sal_Bool bForceTo = sal_True; const OTypeInfoMap* pTypeInfoMap = m_pConnection->getTypeInfo(); - const ::connectivity::OTypeInfo* pTypeInfo = OConnection::getTypeInfoFromType(*m_pConnection->getTypeInfo(),m_Type,::rtl::OUString(),m_Precision,m_Scale,bForceTo); + const OExtendedTypeInfo* pTypeInfo = OConnection::getTypeInfoFromType(*m_pConnection->getTypeInfo(),m_Type,::rtl::OUString(),m_Precision,m_Scale,m_aColumn.get_Type(),bForceTo); if ( pTypeInfo ) - m_TypeName = pTypeInfo->aTypeName; + m_TypeName = pTypeInfo->aSimpleType.aTypeName; // fill some specific props { @@ -276,6 +294,16 @@ void OAdoColumn::fillPropertyValues() m_Description = OTools::getValue( aProps, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Description")) ); m_DefaultValue = OTools::getValue( aProps, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Default")) ); + +#ifdef _DEBUG + sal_Int32 nCount = aProps.GetItemCount(); + for (sal_Int32 i = 0; i<nCount; ++i) + { + WpADOProperty aProp = aProps.GetItem(i); + ::rtl::OUString sName = aProp.GetName(); + ::rtl::OUString sVal = aProp.GetValue(); + } +#endif } } } diff --git a/connectivity/source/drivers/ado/AColumns.cxx b/connectivity/source/drivers/ado/AColumns.cxx index ac0883f8a993..f35a332683e6 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.11 $ + * $Revision: 1.12 $ * - * last change: $Author: oj $ $Date: 2002-07-22 10:05:54 $ + * last change: $Author: oj $ $Date: 2002-11-29 12:24:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -128,15 +128,36 @@ void OColumns::appendObject( const Reference< XPropertySet >& descriptor ) sal_Int32 nScale = aColumn.get_NumericScale(); sal_Int32 nType = ADOS::MapADOType2Jdbc(eType); + ::rtl::OUString sTypeName; + pColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME)) >>= sTypeName; + sal_Bool bForceTo = sal_True; const OTypeInfoMap* pTypeInfoMap = m_pConnection->getTypeInfo(); - const ::connectivity::OTypeInfo* pTypeInfo = OConnection::getTypeInfoFromType(*m_pConnection->getTypeInfo(),nType,::rtl::OUString(),nPrecision,nScale,bForceTo); - if ( pTypeInfo && pTypeInfo->bCurrency ) // change column type if necessary - aColumn.put_Type(adCurrency); + const OExtendedTypeInfo* pTypeInfo = OConnection::getTypeInfoFromType( *m_pConnection->getTypeInfo() + ,nType + ,sTypeName + ,nPrecision + ,nScale + ,eType + ,bForceTo); + if ( pTypeInfo && static_cast<DataTypeEnum>(pTypeInfo->eType) != eType ) // change column type if necessary + aColumn.put_Type(static_cast<DataTypeEnum>(pTypeInfo->eType)); + + ((ADOColumns*)m_aCollection)->Append(OLEVariant(aColumn.get_Name()),aColumn.get_Type(),aColumn.get_DefinedSize()); + WpADOColumn aAddedColumn = m_aCollection.GetItem(OLEVariant(aColumn.get_Name())); + sal_Bool bAutoIncrement = sal_False; + pColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)) >>= bAutoIncrement; + if ( bAutoIncrement ) + OTools::putValue( aAddedColumn.get_Properties(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Autoincrement")), bAutoIncrement ); - if ( !m_aCollection.Append(aColumn) ) - ADOS::ThrowException(*m_pConnection->getConnection(),*this); + aAddedColumn.put_Precision(aColumn.get_Precision()); + aAddedColumn.put_NumericScale(aColumn.get_NumericScale()); + aAddedColumn.put_Attributes(aColumn.get_Attributes()); + aAddedColumn.put_SortOrder(aColumn.get_SortOrder()); + aAddedColumn.put_RelatedColumn(aColumn.get_RelatedColumn()); + + ADOS::ThrowException(*m_pConnection->getConnection(),*this); } else throw SQLException(::rtl::OUString::createFromAscii("Could not append column!"),*this,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx index 3d50be769657..725f20993bad 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.19 $ + * $Revision: 1.20 $ * - * last change: $Author: oj $ $Date: 2002-08-23 10:06:33 $ + * last change: $Author: oj $ $Date: 2002-11-29 12:24:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -126,7 +126,8 @@ OConnection::OConnection(const ::rtl::OUString& url, const Sequence< PropertyVal m_pDriver(_pDriver), m_pAdoConnection(NULL), m_bAutocommit(sal_True), - m_nEngineType(0) + m_nEngineType(0), + m_pCatalog(NULL) { ModuleContext::AddRef(); @@ -483,40 +484,50 @@ void OConnection::buildTypeInfo() throw( SQLException) { ::osl::MutexGuard aGuard( m_aMutex ); - Reference< XResultSet> xRs = getMetaData()->getTypeInfo(); - Reference< XRow> xRow(xRs,UNO_QUERY); - // Information for a single SQL type - - // Loop on the result set until we reach end of file - while (xRs->next()) + ADORecordset *pRecordset = m_pAdoConnection->getTypeInfo(); + if ( pRecordset ) { - OTypeInfo* aInfo = new OTypeInfo(); - aInfo->aTypeName = xRow->getString (1); - aInfo->nType = xRow->getShort (2); - aInfo->nPrecision = xRow->getInt (3); - aInfo->aLiteralPrefix = xRow->getString (4); - aInfo->aLiteralSuffix = xRow->getString (5); - aInfo->aCreateParams = xRow->getString (6); - aInfo->bNullable = xRow->getInt (7) == ColumnValue::NULLABLE; - aInfo->bCaseSensitive = xRow->getBoolean (8); - aInfo->nSearchType = xRow->getShort (9); - aInfo->bUnsigned = xRow->getBoolean (10); - aInfo->bCurrency = xRow->getBoolean (11); - aInfo->bAutoIncrement = xRow->getBoolean (12); - aInfo->aLocalTypeName = xRow->getString (13); - aInfo->nMinimumScale = xRow->getShort (14); - aInfo->nMaximumScale = xRow->getShort (15); - aInfo->nNumPrecRadix = (sal_Int16)xRow->getInt (18); - // Now that we have the type info, save it - // in the Hashtable if we don't already have an - // entry for this SQL type. - - m_aTypeInfo.insert(OTypeInfoMap::value_type(aInfo->nType,aInfo)); - } + pRecordset->AddRef(); + VARIANT_BOOL bIsAtBOF; + pRecordset->get_BOF(&bIsAtBOF); - // Close the result set/statement. + sal_Bool bOk = sal_True; + if ( bIsAtBOF == VARIANT_TRUE ) + bOk = SUCCEEDED(pRecordset->MoveNext()); - Reference< XCloseable>(xRs,UNO_QUERY)->close(); + if ( bOk ) + { + do + { + sal_Int32 nPos = 1; + OExtendedTypeInfo* aInfo = new OExtendedTypeInfo(); + aInfo->aSimpleType.aTypeName = ADOS::getField(pRecordset,nPos++).get_Value(); + aInfo->eType = ADOS::getField(pRecordset,nPos++).get_Value(); + aInfo->aSimpleType.nType = ADOS::MapADOType2Jdbc(static_cast<DataTypeEnum>(aInfo->eType)); + aInfo->aSimpleType.nPrecision = ADOS::getField(pRecordset,nPos++).get_Value(); + aInfo->aSimpleType.aLiteralPrefix = ADOS::getField(pRecordset,nPos++).get_Value(); + aInfo->aSimpleType.aLiteralSuffix = ADOS::getField(pRecordset,nPos++).get_Value(); + aInfo->aSimpleType.aCreateParams = ADOS::getField(pRecordset,nPos++).get_Value(); + aInfo->aSimpleType.bNullable = ADOS::getField(pRecordset,nPos++).get_Value(); + aInfo->aSimpleType.bCaseSensitive = ADOS::getField(pRecordset,nPos++).get_Value(); + aInfo->aSimpleType.nSearchType = ADOS::getField(pRecordset,nPos++).get_Value(); + aInfo->aSimpleType.bUnsigned = ADOS::getField(pRecordset,nPos++).get_Value(); + aInfo->aSimpleType.bCurrency = ADOS::getField(pRecordset,nPos++).get_Value(); + aInfo->aSimpleType.bAutoIncrement = ADOS::getField(pRecordset,nPos++).get_Value(); + aInfo->aSimpleType.aLocalTypeName = ADOS::getField(pRecordset,nPos++).get_Value(); + aInfo->aSimpleType.nMinimumScale = ADOS::getField(pRecordset,nPos++).get_Value(); + aInfo->aSimpleType.nMaximumScale = ADOS::getField(pRecordset,nPos++).get_Value(); + aInfo->aSimpleType.nNumPrecRadix = ADOS::getField(pRecordset,nPos++).get_Value(); + // Now that we have the type info, save it + // in the Hashtable if we don't already have an + // entry for this SQL type. + + m_aTypeInfo.insert(OTypeInfoMap::value_type(aInfo->aSimpleType.nType,aInfo)); + } + while ( SUCCEEDED(pRecordset->MoveNext()) ); + } + pRecordset->Release(); + } } //------------------------------------------------------------------------------ void OConnection::disposing() @@ -572,14 +583,15 @@ Sequence< sal_Int8 > OConnection::getUnoTunnelImplementationId() return pId->getImplementationId(); } // ----------------------------------------------------------------------------- -const ::connectivity::OTypeInfo* OConnection::getTypeInfoFromType(const OTypeInfoMap& _rTypeInfo, +const OExtendedTypeInfo* OConnection::getTypeInfoFromType(const OTypeInfoMap& _rTypeInfo, sal_Int32 _nType, const ::rtl::OUString& _sTypeName, sal_Int32 _nPrecision, sal_Int32 _nScale, + sal_Int32 _nAdoType, sal_Bool& _brForceToType) { - const ::connectivity::OTypeInfo* pTypeInfo = NULL; + const OExtendedTypeInfo* pTypeInfo = NULL; _brForceToType = sal_False; // search for type ::std::pair<OTypeInfoMap::const_iterator, OTypeInfoMap::const_iterator> aPair = _rTypeInfo.equal_range(_nType); @@ -590,15 +602,16 @@ const ::connectivity::OTypeInfo* OConnection::getTypeInfoFromType(const OTypeInf { // search the best matching type #ifdef DBG_UTIL - ::rtl::OUString sDBTypeName = aIter->second->aTypeName; - sal_Int32 nDBTypePrecision = aIter->second->nPrecision; - sal_Int32 nDBTypeScale = aIter->second->nMaximumScale; + ::rtl::OUString sDBTypeName = aIter->second->aSimpleType.aTypeName; + sal_Int32 nDBTypePrecision = aIter->second->aSimpleType.nPrecision; + sal_Int32 nDBTypeScale = aIter->second->aSimpleType.nMaximumScale; + sal_Int32 nAdoType = aIter->second->eType; #endif if ( ( !_sTypeName.getLength() - || (aIter->second->aTypeName.equalsIgnoreAsciiCase(_sTypeName)) + || (aIter->second->aSimpleType.aTypeName.equalsIgnoreAsciiCase(_sTypeName)) ) - && (aIter->second->nPrecision >= _nPrecision) - && (aIter->second->nMaximumScale >= _nScale) + && (aIter->second->aSimpleType.nPrecision >= _nPrecision) + && (aIter->second->aSimpleType.nMaximumScale >= _nScale) ) break; } @@ -608,9 +621,9 @@ const ::connectivity::OTypeInfo* OConnection::getTypeInfoFromType(const OTypeInf for(aIter = aPair.first; aIter != aPair.second; ++aIter) { // search the best matching type (now comparing the local names) - if ( (aIter->second->aLocalTypeName.equalsIgnoreAsciiCase(_sTypeName)) - && (aIter->second->nPrecision >= _nPrecision) - && (aIter->second->nMaximumScale >= _nScale) + if ( (aIter->second->aSimpleType.aLocalTypeName.equalsIgnoreAsciiCase(_sTypeName)) + && (aIter->second->aSimpleType.nPrecision >= _nPrecision) + && (aIter->second->aSimpleType.nMaximumScale >= _nScale) ) { // we can not assert here because we could be in d&d @@ -655,7 +668,7 @@ const ::connectivity::OTypeInfo* OConnection::getTypeInfoFromType(const OTypeInf ::std::compose1( ::std::bind2nd(aCase, _sTypeName), ::std::compose1( - ::std::mem_fun(&::connectivity::OTypeInfo::getDBName), + ::std::mem_fun(&OExtendedTypeInfo::getDBName), ::std::select2nd<OTypeInfoMap::value_type>()) ) ); diff --git a/connectivity/source/drivers/ado/ADriver.cxx b/connectivity/source/drivers/ado/ADriver.cxx index b7ab1ca4a7ac..a423beee7294 100644 --- a/connectivity/source/drivers/ado/ADriver.cxx +++ b/connectivity/source/drivers/ado/ADriver.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ADriver.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: oj $ $Date: 2002-08-21 13:14:58 $ + * last change: $Author: oj $ $Date: 2002-11-29 12:24:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -235,8 +235,10 @@ Reference< XTablesSupplier > SAL_CALL ODriver::getDataDefinitionByConnection( co if(aCatalog.IsValid()) { aCatalog.putref_ActiveConnection(*pConnection->getConnection()); - xTab = new OCatalog(aCatalog,pConnection); + OCatalog* pCatalog = new OCatalog(aCatalog,pConnection); + xTab = pCatalog; pConnection->setCatalog(xTab); + pConnection->setCatalog(pCatalog); } } return xTab; diff --git a/connectivity/source/drivers/ado/AIndex.cxx b/connectivity/source/drivers/ado/AIndex.cxx index c38804fee6c6..08093577c9fb 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.17 $ + * $Revision: 1.18 $ * - * last change: $Author: fs $ $Date: 2002-01-18 16:33:01 $ + * last change: $Author: oj $ $Date: 2002-11-29 12:24:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -126,7 +126,7 @@ void OAdoIndex::refreshColumns() aColumns.fillElementNames(aVector); } - if(m_pColumns) + if ( m_pColumns ) m_pColumns->reFill(aVector); else m_pColumns = new OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection); diff --git a/connectivity/source/drivers/ado/AResultSetMetaData.cxx b/connectivity/source/drivers/ado/AResultSetMetaData.cxx index 08f3f4c86b45..7d06439df279 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.5 $ + * $Revision: 1.6 $ * - * last change: $Author: oj $ $Date: 2001-07-30 08:52:12 $ + * last change: $Author: oj $ $Date: 2002-11-29 12:24:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -120,7 +120,15 @@ sal_Int32 SAL_CALL OResultSetMetaData::getColumnCount( ) throw(SQLException, Ru sal_Bool SAL_CALL OResultSetMetaData::isCaseSensitive( sal_Int32 column ) throw(SQLException, RuntimeException) { - return sal_True; + sal_Bool bRet = sal_False; + WpADOField aField = ADOS::getField(m_pRecordSet,column); + if ( aField.IsValid() ) + { + WpADOProperties aProps( aField.get_Properties() ); + if ( aProps.IsValid() ) + bRet = OTools::getValue( aProps, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ISCASESENSITIVE")) ); + } + return bRet; } // ------------------------------------------------------------------------- @@ -141,7 +149,16 @@ sal_Bool SAL_CALL OResultSetMetaData::isCaseSensitive( sal_Int32 column ) throw( // ------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OResultSetMetaData::getTableName( sal_Int32 column ) throw(SQLException, RuntimeException) { - return ::rtl::OUString(); + ::rtl::OUString sTableName; + + WpADOField aField = ADOS::getField(m_pRecordSet,column); + if ( aField.IsValid() ) + { + WpADOProperties aProps( aField.get_Properties() ); + if ( aProps.IsValid() ) + sTableName = OTools::getValue( aProps, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BASETABLENAME")) ); + } + return sTableName; } // ------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OResultSetMetaData::getCatalogName( sal_Int32 column ) throw(SQLException, RuntimeException) @@ -178,7 +195,26 @@ sal_Bool SAL_CALL OResultSetMetaData::isCurrency( sal_Int32 column ) throw(SQLEx sal_Bool SAL_CALL OResultSetMetaData::isAutoIncrement( sal_Int32 column ) throw(SQLException, RuntimeException) { - return sal_False; + sal_Bool bRet = sal_False; + WpADOField aField = ADOS::getField(m_pRecordSet,column); + if ( aField.IsValid() ) + { + WpADOProperties aProps( aField.get_Properties() ); + if ( aProps.IsValid() ) + { + bRet = OTools::getValue( aProps, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ISAUTOINCREMENT")) ); +#ifdef _DEBUG + sal_Int32 nCount = aProps.GetItemCount(); + for (sal_Int32 i = 0; i<nCount; ++i) + { + WpADOProperty aProp = aProps.GetItem(i); + ::rtl::OUString sName = aProp.GetName(); + ::rtl::OUString sVal = aProp.GetValue(); + } +#endif + } + } + return bRet; } // ------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/ado/ATable.cxx b/connectivity/source/drivers/ado/ATable.cxx index d4e7863e278c..cfa9e35d58c1 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.24 $ + * $Revision: 1.25 $ * - * last change: $Author: oj $ $Date: 2002-07-11 06:56:39 $ + * last change: $Author: oj $ $Date: 2002-11-29 12:24:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -129,6 +129,7 @@ OAdoTable::OAdoTable(sdbcx::OCollection* _pTables,sal_Bool _bCase,OCatalog* _pCa { construct(); m_aTable = WpADOTable(_pTable); + // m_aTable.putref_ParentCatalog(_pCatalog->getCatalog()); fillPropertyValues(); } diff --git a/connectivity/source/drivers/ado/ATables.cxx b/connectivity/source/drivers/ado/ATables.cxx index 6661f02c3826..6520b4ff0fbd 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.11 $ + * $Revision: 1.12 $ * - * last change: $Author: oj $ $Date: 2001-11-15 10:50:24 $ + * last change: $Author: oj $ $Date: 2002-11-29 12:24:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -138,6 +138,7 @@ void OTables::appendObject( const Reference< XPropertySet >& descriptor ) OSL_ENSURE(m_aCollection.IsValid(),"Collection isn't valid"); if(!m_aCollection.Append(pTable->getImpl())) ADOS::ThrowException(*m_pCatalog->getConnection()->getConnection(),*this); + m_aCollection.Refresh(); } else throw SQLException(::rtl::OUString::createFromAscii("Could not append table!"),*this,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); diff --git a/connectivity/source/drivers/ado/Awrapado.cxx b/connectivity/source/drivers/ado/Awrapado.cxx index 441133d86e2e..0221aa51e8f4 100644 --- a/connectivity/source/drivers/ado/Awrapado.cxx +++ b/connectivity/source/drivers/ado/Awrapado.cxx @@ -2,9 +2,9 @@ * * $RCSfile: Awrapado.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: fs $ $Date: 2002-01-18 16:35:28 $ + * last change: $Author: oj $ $Date: 2002-11-29 12:24:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1116,6 +1116,13 @@ void WpADOColumn::put_Precision(sal_Int32 _nPre) pInterface->put_Precision(_nPre); } +sal_Int32 WpADOColumn::get_DefinedSize() const +{ + OSL_ENSURE(pInterface,"Interface is null!"); + sal_Int32 nPrec=0; + pInterface->get_DefinedSize(&nPrec); + return nPrec; +} sal_Int32 WpADOColumn::get_NumericScale() const { OSL_ENSURE(pInterface,"Interface is null!"); @@ -2165,13 +2172,15 @@ ADORecordset* WpADOConnection::getTypeInfo( ) void WpADOColumn::put_ParentCatalog(/* [in] */ _ADOCatalog __RPC_FAR *ppvObject) { OSL_ENSURE(pInterface,"Interface is null!"); - OSL_ENSURE(SUCCEEDED(pInterface->put_ParentCatalog(ppvObject)),"Could not set ParentCatalog!"); + sal_Bool bRet = SUCCEEDED(pInterface->put_ParentCatalog(ppvObject)); + OSL_ENSURE(bRet,"Could not set ParentCatalog!"); } // ----------------------------------------------------------------------------- void WpADOTable::putref_ParentCatalog(/* [in] */ _ADOCatalog __RPC_FAR *ppvObject) { OSL_ENSURE(pInterface,"Interface is null!"); - OSL_ENSURE(SUCCEEDED(pInterface->putref_ParentCatalog(ppvObject)),"Could not set ParentCatalog!"); + sal_Bool bRet = SUCCEEDED(pInterface->putref_ParentCatalog(ppvObject)); + OSL_ENSURE(bRet,"Could not set ParentCatalog!"); } // ----------------------------------------------------------------------------- void WpBase::setIDispatch(IDispatch* _pIUnknown) @@ -2183,8 +2192,11 @@ void OTools::putValue(const WpADOProperties& _rProps,const OLEVariant &_aPositio { OSL_ENSURE(_rProps.IsValid(),"Properties are not valid!"); WpADOProperty aProp(_rProps.GetItem(_aPosition)); - if(aProp.IsValid()) - aProp.PutValue(_aValVar); + if ( aProp.IsValid() ) + { + sal_Bool bRet = aProp.PutValue(_aValVar); + OSL_ENSURE(bRet,"Could not put value!"); + } } // ----------------------------------------------------------------------------- OLEVariant OTools::getValue(const WpADOProperties& _rProps,const OLEVariant &_aPosition) |