GetNewOpenConnectionFMZOLL_SYSTEM _>gGUIDE!!!

This commit is contained in:
2026-02-25 14:37:10 +01:00
parent bb638c47f4
commit 2cac04acc6
2 changed files with 21 additions and 5 deletions

View File

@@ -190,7 +190,7 @@ Public Class cDatenbankAVISO
End If End If
Return GlobalConnectionFMZOLL Return GlobalConnectionFMZOLL
Catch ex As Exception Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR("Es konnte keine Verbindung zur Datenbank aufgebaut werden!! " & ex.Message, "Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR("SQLGUIDE01_USED: " & VERAG_PROG_ALLGEMEIN.cAllgemein.SQLGUIDE01_USED & " Es konnte keine Verbindung zur Datenbank aufgebaut werden!! " & ex.Message, "Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
' MsgBox("Es konnte keine Verbindung zur Datenbank aufgebaut werden!! " & vbCrLf & vbNewLine & vbCrLf & "Fehler: " & ex.Message) ' MsgBox("Es konnte keine Verbindung zur Datenbank aufgebaut werden!! " & vbCrLf & vbNewLine & vbCrLf & "Fehler: " & ex.Message)
End Try End Try
Return Nothing Return Nothing

View File

@@ -60,7 +60,8 @@ Public Class SQL
Return My.MySettings.Default.FMZOLL_PRODConnectionString Return My.MySettings.Default.FMZOLL_PRODConnectionString
Catch ex As Exception Catch ex As Exception
' Return "Data Source=192.168.0.91\SQLFMZOLL;Initial Catalog=VERAG;Integrated Security=false;User ID=test;Password=BmWr501956;" ' Return "Data Source=192.168.0.91\SQLFMZOLL;Initial Catalog=VERAG;Integrated Security=false;User ID=test;Password=BmWr501956;"
Return "Data Source=192.168.0.91\SQLFMZOLL;Initial Catalog=VERAG;Integrated Security=false;User ID=test;Password=BmWr501956;" ' Return "Data Source=192.168.0.91\SQLFMZOLL;Initial Catalog=VERAG;Integrated Security=false;User ID=test;Password=BmWr501956;"
Return "Data Source=SQLGUIDE01.verag.ost.dmn;Initial Catalog=VERAG;Integrated Security=false;User ID=AppUser;Password=yp/THDd?xM+pZ$;"
End Try End Try
End If End If
@@ -139,10 +140,14 @@ Public Class SQL
Return My.MySettings.Default.FMZOLLConnectionString Return My.MySettings.Default.FMZOLLConnectionString
Else Else
Try Try
If VERAG_PROG_ALLGEMEIN.cAllgemein.SQLGUIDE01_USED Then
Return My.MySettings.Default.VERAGConnectionStringPROD
End If
Return My.MySettings.Default.FMZOLL_PRODConnectionString Return My.MySettings.Default.FMZOLL_PRODConnectionString
Catch ex As Exception Catch ex As Exception
' Return "Data Source=192.168.0.91\SQLFMZOLL;Initial Catalog=VERAG;Integrated Security=false;User ID=test;Password=BmWr501956;" ' Return "Data Source=192.168.0.91\SQLFMZOLL;Initial Catalog=VERAG;Integrated Security=false;User ID=test;Password=BmWr501956;"
Return "Data Source=192.168.0.91\SQLFMZOLL;Initial Catalog=VERAG;Integrated Security=false;User ID=test;Password=BmWr501956;" ' Return "Data Source=192.168.0.91\SQLFMZOLL;Initial Catalog=VERAG;Integrated Security=false;User ID=test;Password=BmWr501956;"
Return "Data Source=SQLGUIDE01.verag.ost.dmn;Initial Catalog=VERAG;Integrated Security=false;User ID=AppUser;Password=yp/THDd?xM+pZ$;"
End Try End Try
End If End If
End Function End Function
@@ -152,6 +157,9 @@ Public Class SQL
Return My.MySettings.Default.AsfinagConnectionStringDEV() Return My.MySettings.Default.AsfinagConnectionStringDEV()
Else Else
Try Try
If VERAG_PROG_ALLGEMEIN.cAllgemein.SQLGUIDE01_USED Then
Return My.MySettings.Default.VERAGConnectionStringPROD
End If
Return My.MySettings.Default.FMZOLL_PRODConnectionString Return My.MySettings.Default.FMZOLL_PRODConnectionString
Catch ex As Exception Catch ex As Exception
' Return "Data Source=192.168.0.91\SQLFMZOLL;Initial Catalog=VERAG;Integrated Security=false;User ID=test;Password=BmWr501956;" ' Return "Data Source=192.168.0.91\SQLFMZOLL;Initial Catalog=VERAG;Integrated Security=false;User ID=test;Password=BmWr501956;"
@@ -297,6 +305,11 @@ Public Class SQL
Public Shared Function GetNewOpenConnectionFMZOLL(Optional pooling As Boolean = True) As SqlConnection Public Shared Function GetNewOpenConnectionFMZOLL(Optional pooling As Boolean = True) As SqlConnection
Dim cn As New SqlConnection() Dim cn As New SqlConnection()
Try Try
'MsgBox(VERAG_PROG_ALLGEMEIN.cAllgemein.SQLGUIDE01_USED)
'MsgBox(GetFMZOLLConnectionString())
cn.ConnectionString = GetFMZOLLConnectionString() & IIf(pooling, "", ";pooling=false") cn.ConnectionString = GetFMZOLLConnectionString() & IIf(pooling, "", ";pooling=false")
cn.Open() cn.Open()
Return cn Return cn
@@ -520,9 +533,12 @@ Public Class SQL
Public Shared Function GetNewOpenConnectionFMZOLLREAL() As SqlConnection Public Shared Function GetNewOpenConnectionFMZOLLREAL() As SqlConnection
Dim cn As New SqlConnection() Dim cn As New SqlConnection()
Try Try
cn.ConnectionString = My.MySettings.Default.FMZOLL_PRODConnectionString
cn.ConnectionString = My.MySettings.Default.VERAGConnectionStringPROD
'cn.ConnectionString = My.MySettings.Default.FMZOLL_PRODConnectionString
cn.Open() cn.Open()
Return cn Return cn
Catch ex As Exception Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, "SQL CONNECTION | " & cn.ConnectionString.Replace("BmWr501956", "*******").Replace("yp/THDd?xM+pZ$", "*******") & " | Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, "SQL CONNECTION | " & cn.ConnectionString.Replace("BmWr501956", "*******").Replace("yp/THDd?xM+pZ$", "*******") & " | Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try End Try