From bd4ce2221f80031f728355d28c0ec027e1d3d85e Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 9 Apr 2019 14:46:37 +0200 Subject: [PATCH] jj: hopefully fix final vectory index with sql command --- app/DD_PM_WINDREAM/frmAdministration.vb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/DD_PM_WINDREAM/frmAdministration.vb b/app/DD_PM_WINDREAM/frmAdministration.vb index be0709d..2af9720 100644 --- a/app/DD_PM_WINDREAM/frmAdministration.vb +++ b/app/DD_PM_WINDREAM/frmAdministration.vb @@ -1015,28 +1015,31 @@ Public Class frmAdministration Else value = ClassFinalIndex.GetValue(obj, obj.IndexName, Windream_Indicies, Windream_Indicies_Types, obj.VectorIndex) End If + value = NotNull(value, String.Empty) Dim guid = obj.GUID Dim profileId As Integer = PROFILGUIDTextBox.Text Dim connectionId As Integer = obj.ConnectionId - Dim sqlCommand As String = obj.SQLCommand.Value.Replace("'", "''") - Dim indexName As String = obj.IndexName + Dim sqlCommand As String = NotNull(obj.SQLCommand.Value, String.Empty).Replace("'", "''") + Dim indexName As String = NotNull(obj.IndexName, String.Empty) Dim isVectorIndex As Boolean = obj.VectorIndex Dim addedWho As String = Environment.UserName Dim description As String = obj.Description Dim active As Integer = IIf(obj.Active, 1, 0) - If NotNull(indexName, "") = String.Empty Then + If indexName = String.Empty Then MsgBox("Das Feld IndexName muss ausgefüllt sein!", MsgBoxStyle.Exclamation) Exit Sub End If - If NotNull(sqlCommand, "") = String.Empty And NotNull(value, "") = String.Empty Then + If sqlCommand = String.Empty And value = String.Empty Then MsgBox("Entweder SQLCommand oder StaticValue müssen ausgefüllt sein!", MsgBoxStyle.Exclamation) Exit Sub End If - If obj.VectorIndex Then + ' Add the vector prefix to the value if index is a vector index + ' and value is NOT an SQL-Command + If obj.VectorIndex And value <> "SQL-Command" Then value = $"{ClassFinalIndex.PREFIX_VECTOR}{value}" End If