This commit is contained in:
SchreiberM
2016-02-29 11:39:57 +01:00
parent e1f073d69f
commit b0a74d2e94
8 changed files with 2146 additions and 3590 deletions

View File

@@ -6,10 +6,15 @@ Public Class ClassFormFunctions
'Me.TBCONNECTIONTableAdapter.FillByID(Me.DD_DMSLiteDataSet.TBCONNECTION, id)
Dim DTConnection As DataTable = ClassDatabase.Return_Datatable("SELECT * FROM TBDD_CONNECTION WHERE GUID = " & id)
If DTConnection.Rows.Count = 1 Then
Select Case DTConnection.Rows(0).Item("SQL_PROVIDER")
Case "MS-SQLServer"
connectionString = "Data Source=" & DTConnection.Rows(0).Item("SERVER") & ";Initial Catalog= " & DTConnection.Rows(0).Item("DATENBANK") & ";User Id=" & DTConnection.Rows(0).Item("USERNAME") & ";Password=" & DTConnection.Rows(0).Item("PASSWORD") & ";"
Case "Oracle"
Select Case DTConnection.Rows(0).Item("SQL_PROVIDER").ToString.ToUpper
Case "MS-SQLServer".ToUpper
If DTConnection.Rows(0).Item("USERNAME").ToString.ToLower = "winauth" Then
connectionString = "Data Source=" & DTConnection.Rows(0).Item("SERVER") & ";Initial Catalog= " & DTConnection.Rows(0).Item("DATENBANK") & ";Trusted_Connection=True;"
Else
connectionString = "Data Source=" & DTConnection.Rows(0).Item("SERVER") & ";Initial Catalog= " & DTConnection.Rows(0).Item("DATENBANK") & ";User Id=" & DTConnection.Rows(0).Item("USERNAME") & ";Password=" & DTConnection.Rows(0).Item("PASSWORD") & ";"
End If
Case "Oracle".ToUpper
If DTConnection.Rows(0).Item("BEMERKUNG").ToString.Contains("without tnsnames") Then
connectionString = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" & DTConnection.Rows(0).Item("SERVER") & ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" & _
DTConnection.Rows(0).Item("DATENBANK") & ")));User Id=" & DTConnection.Rows(0).Item("USERNAME") & ";Password=" & DTConnection.Rows(0).Item("PASSWORD") & ";"
@@ -35,14 +40,14 @@ Public Class ClassFormFunctions
'Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;Integrated Security=no;
Case Else
ClassLogger.Add(" - ConnectionType nicht integriert", False)
MsgBox("ConnectionType nicht integriert", MsgBoxStyle.Critical, "Bitte Konfiguration Connection überprüfen!")
ClassLogger.Add(" - ConnectionType not integrated", False)
MsgBox("ConnectionType not integrated", MsgBoxStyle.Critical, "Please check connection:")
End Select
End If
Catch ex As Exception
ClassLogger.Add(" - Unvorhergesehener Fehler bei GetConnectionString - Fehler: " & vbNewLine & ex.Message)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei GetConnectionString:")
ClassLogger.Add(" - Unexpected Error in GetConnectionString:" & vbNewLine & ex.Message)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in GetConnectionString:")
End Try
Return connectionString