diff options
Diffstat (limited to 'wizards/source/tools/Misc.xba')
-rw-r--r-- | wizards/source/tools/Misc.xba | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/wizards/source/tools/Misc.xba b/wizards/source/tools/Misc.xba index 2f06e92a5938..9aa6d2e2f380 100644 --- a/wizards/source/tools/Misc.xba +++ b/wizards/source/tools/Misc.xba @@ -58,7 +58,7 @@ End Function ' Connects to a registered Database -Function ConnecttoDatabase(DSName as String, UserID as String, Password as String, Optional Propertylist(), Optional DriverProperties() as New com.sun.star.beans.PropertyValue) +Function ConnectToDatabase(DSName as String, UserID as String, Password as String, Optional Propertylist(), Optional DriverProperties() as New com.sun.star.beans.PropertyValue) Dim oDBContext as Object Dim oDBSource as Object ' On Local Error Goto NOCONNECTION @@ -68,11 +68,7 @@ Dim oDBSource as Object ConnectToDatabase = oDBSource.GetConnection(UserID, Password) Else If Not IsMissing(Propertylist()) Then - If Not IsMissing(DriverProperties()) Then - RegisterNewDataSource(DSName, PropertyList(), DriverProperties()) - Else - RegisterNewDataSource(DSName, PropertyList()) - End If + RegisterNewDataSource(DSName, PropertyList(), DriverProperties()) oDBSource = oDBContext.GetByName(DSName) ConnectToDatabase = oDBSource.GetConnection(UserID, Password) Else @@ -114,14 +110,11 @@ Dim aNodePath(0) as new com.sun.star.beans.PropertyValue oConfigProvider = createUnoService("com.sun.star.configuration.ConfigurationProvider") aNodePath(0).Name = "nodepath" aNodePath(0).Value = sKeyName - If IsMissing(bForUpdate) Then - GetRegistryKeyContent() = oConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", aNodePath()) + If IsMissing(bForUpdate) Then bForUpdate = False + If bForUpdate Then + GetRegistryKeyContent() = oConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess", aNodePath()) Else - If bForUpdate Then - GetRegistryKeyContent() = oConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess", aNodePath()) - Else - GetRegistryKeyContent() = oConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", aNodePath()) - End If + GetRegistryKeyContent() = oConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", aNodePath()) End If End Function |