' expO1 Data provider Private Function ProcessTaskQuery(ByVal toDataProvider As Framework.Data) As Boolean Dim lnCounter As Integer = 0 Dim loDataProvider As Framework.Data = New Framework.Data(oApp) Dim loRow As DataRow = Nothing Dim loUpdate As Framework.Update = New Framework.Update(oApp) ' We have to get the primary key of the server to know if it is running loDataProvider.ParameterAdd("Numero", nRobotPrimaryKey, , "Robot", "Numero") If Not loDataProvider.SQLExec("SELECT Robot.NoServer,Robot.Run " + _ "FROM Robot " + _ "WHERE Robot.Numero=" + loDataProvider.ParameterAddSQL("Numero")) Then Return False End If loRow = loDataProvider.oDataView(0).Row ' If the robot server and Run do not match If oApp.nNoServer <> loRow("NoServer") Or Not loRow("Run") Then ' Reset the parameter on the robot loUpdate.cAlias = "Robot" loUpdate.nPrimaryKey = nRobotPrimaryKey loUpdate.ParameterAdd("Loop", 0) loUpdate.ParameterAdd("Version", "") If Not loUpdate.Update() Then Return False End If CloseForm() End IfBasically, what is of interest to us here is the Or Not loRow("Run"). This is the flag. So, if the Robot.Run field is False, it indicates to the robot application to close. Before doing it, I update a few fields in the table. But, this is not a factor. The next line calls CloseForm().
Public Sub CloseForm() Close() End SubSo, based on the fact that this project is only one Main.vb form, which is the startup form to run from the Project Properties, is Application.Exit() better?