diff --git a/VERAGAddIn/ThisAddIn.vb b/VERAGAddIn/ThisAddIn.vb index 0791be4..4341c14 100644 --- a/VERAGAddIn/ThisAddIn.vb +++ b/VERAGAddIn/ThisAddIn.vb @@ -5,6 +5,7 @@ Imports System.Reflection Imports System.Windows.Forms Imports Microsoft.Office.Core Imports System.Dynamic +Imports SDL 'Option Private Module 'Imports Microsoft.Office.Core @@ -27,6 +28,7 @@ Public Class ThisAddIn inspectors = Me.Application.Inspectors currentExplorer = Me.Application.ActiveExplorer SharedExplorer = currentExplorer + checkConnection() AddHandler VERAGRibbon.bla, Sub() ' MsgBox("JOAS") @@ -173,6 +175,23 @@ Public Class ThisAddIn ' wdDoc.Close(False) ' wdApp.Quit() End Sub + + + Public Sub checkConnection() + + + Dim con = New VERAG_PROG_ALLGEMEIN.SQL + + If con.getValueTxtBySql("SELECT 1", "FMZOLL") <> 1 Then + MsgBox("ACHTUNG: Server nicht erreichbar!" & vbCrLf & "VERAG ADD In wird beendet") + Application.Quit() + End If + + + + + End Sub + End Class diff --git a/VERAGAddIn/rbnVERAG.vb b/VERAGAddIn/rbnVERAG.vb index 75e881a..9d862cc 100644 --- a/VERAGAddIn/rbnVERAG.vb +++ b/VERAGAddIn/rbnVERAG.vb @@ -38,9 +38,7 @@ Public Class VERAGRibbon 'VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True LOGIN_OK = AVISO_Mail_Functions.initFirmaUser() - If testConnection() = False Then - Windows.Forms.Application.Exit() - End If + End Sub