summaryrefslogtreecommitdiff
path: root/basic/qa/cppunit/test_vba.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'basic/qa/cppunit/test_vba.cxx')
-rw-r--r--basic/qa/cppunit/test_vba.cxx24
1 files changed, 22 insertions, 2 deletions
diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx
index 265aaf6f7e91..83d243d21dc0 100644
--- a/basic/qa/cppunit/test_vba.cxx
+++ b/basic/qa/cppunit/test_vba.cxx
@@ -10,6 +10,13 @@
#include <comphelper/processfactory.hxx>
#include <unotools/syslocaleoptions.hxx>
+#ifdef WIN32
+#include <string.h>
+
+#include <windows.h>
+#include <odbcinst.h>
+#endif
+
using namespace ::com::sun::star;
namespace
@@ -96,13 +103,26 @@ void VBATest::testMiscOLEStuff()
bool bOk = false;
if( xOLEFactory.is() )
{
- uno::Reference< uno::XInterface > xExcel = xOLEFactory->createInstance( "Excel.Application" );
uno::Reference< uno::XInterface > xADODB = xOLEFactory->createInstance( "ADODB.Connection" );
- bOk = xExcel.is() && xADODB.is();
+ bOk = xADODB.is();
}
if ( !bOk )
return; // can't do anything, skip test
+ sal_Unicode sBuf[1024*4];
+ SQLGetInstalledDriversW( sBuf, sizeof( sBuf ), nullptr );
+
+ const sal_Unicode *pODBCDriverName = sBuf;
+ bool bFound = false;
+ for (; wcslen( pODBCDriverName ) != 0; pODBCDriverName += wcslen( pODBCDriverName ) + 1 ) {
+ if ( wcsstr( pODBCDriverName, L"Microsoft Excel Driver" ) != nullptr ) {
+ bFound = true;
+ break;
+ }
+ }
+ if ( !bFound )
+ return; // can't find ODBC driver needed test, so skip test
+
const char* macroSource[] = {
"ole_ObjAssignNoDflt.vb",
"ole_ObjAssignToNothing.vb",