Tag: cws_src680_dba205c User: fs Date: 2006/10/10 06:40:33 Modified: dba/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
Log: during #i69227#: saveField: quote the field name, in case it contains a space File Changes: Directory: /dba/dbaccess/source/ui/querydesign/ =============================================== File [changed]: SelectionBrowseBox.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx?r1=1.73&r2=1.73.14.1 Delta lines: +12 -4 -------------------- --- SelectionBrowseBox.cxx 17 Sep 2006 07:24:03 -0000 1.73 +++ SelectionBrowseBox.cxx 10 Oct 2006 13:40:31 -0000 1.73.14.1 @@ -4,9 +4,9 @@ * * $RCSfile: SelectionBrowseBox.cxx,v $ * - * $Revision: 1.73 $ + * $Revision: 1.73.14.1 $ * - * last change: $Author: obo $ $Date: 2006/09/17 07:24:03 $ + * last change: $Author: fs $ $Date: 2006/10/10 13:40:31 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -718,13 +718,21 @@ return bError; } + Reference<XConnection> xConnection( pController->getConnection() ); + Reference< XDatabaseMetaData > xMetaData; + if ( xConnection.is() ) + xMetaData = xConnection->getMetaData(); + OSL_ENSURE( xMetaData.is(), "OSelectionBrowseBox::saveField: invalid connection/meta data!" ); + if ( !xMetaData.is() ) + return sal_True; + ::rtl::OUString sErrorMsg; // second test if the name can be set as select columns in a pseudo statement // we have to look which entries we should quote ::rtl::OUString sSql; sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT ")); - sSql += _sFieldName; + sSql += ::dbtools::quoteName( xMetaData->getIdentifierQuoteString(), _sFieldName ); sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FROM x")); ::connectivity::OSQLParser& rParser( pController->getParser() ); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
