Uffff, gracias! Ahora veo esto:
Private Sub Authenticate()
Dim connected As Boolean
Me.Refresh
If Not DatabaseConnect.ConnectedSuccessfully Then
Me.Cursor = Cursors.WaitCursor
connected = Common.TryConnecting(True)
Me.Cursor = Cursors.Default
Else
connected = True
End If
If Not connected Then
Return
End If
Try
connected = DatabaseConnect.Login(Me._userName.Text, Me._password.Text, Me._provider)
Catch err As Exception
MessageBox.Show(("The login failed for the following reason:" & ChrW(13) & ChrW(10) & err.Message), Application.ProductName)
Return
End Try
If Not connected Then
MessageBox.Show("Invalid login or password.", Application.ProductName)
goto Label_01D2
End If
If ((Not Me._provider Is Nothing) AndAlso Not Me._provider.HasActivation) Then
MessageBox.Show("This user has not been activated.", Application.ProductName)
goto Label_01D2
End If
If ((Not Me._provider Is Nothing) AndAlso Not Me._provider.HasValidActivation) Then
MessageBox.Show("This user does not have a valid activation code.", Application.ProductName)
goto Label_01D2
End If
Dim isOK As Boolean = True
If (DatabaseUpdate.UpdateRequired AndAlso (Common.CurrentProviderSecurityLevel <> SecurityLevel.Administrator)) Then
MessageBox.Show("The database needs to be converted a new version. Only users with administrator rights can do so.", Application.ProductName)
isOK = False
ElseIf (DatabaseUpdate.UpdateRecommended AndAlso (Common.CurrentProviderSecurityLevel <> SecurityLevel.Administrator)) Then
isOK = True
Else
If (DatabaseUpdate.UpdateRequired AndAlso (Common.CurrentProviderSecurityLevel = SecurityLevel.Administrator)) Then
If (MessageBox.Show("The database must be updated before you can continue. Press Yes to update the database now.", Application.ProductName, MessageBoxButtons.YesNo) = DialogResult.No) Then
isOK = False
goto Label_018C
End If
Try
isOK = DatabaseUpdate.UpdateDatabase
goto Label_018C
Catch exception As Exception
Common.LogAndDisplayError(exception, "The update process failed")
isOK = False
goto Label_018C
End Try
End If
If (DatabaseUpdate.UpdateRecommended AndAlso (Common.CurrentProviderSecurityLevel = SecurityLevel.Administrator)) Then
If (MessageBox.Show("The database should be updated before continuing. Press Yes to update the database now.", Application.ProductName, MessageBoxButtons.YesNo) = DialogResult.No) Then
isOK = True
Else
Try
isOK = DatabaseUpdate.UpdateDatabase
Catch exception As Exception
Common.LogAndDisplayError(exception, "The update process failed")
isOK = False
End Try
End If
End If
End If
Label_018C:
If isOK Then
ConfigurationManager.LocalSettingsProfile.SetValue("Login", "LastUserName", Me._userName.Text)
MyBase.DialogResult = DialogResult.OK
Me.Refresh
MyBase.Close
Return
End If
Label_01D2:
Me._password.SelectAll
End Sub
Realmente entre tantos procedimientos no sé por donde seguir la pista