MS_KW8
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user