Ver Mensaje Individual
  #2 (permalink)  
Antiguo 31/05/2013, 23:31
KenMasters
 
Fecha de Ingreso: abril-2005
Ubicación: Piura - Perú
Mensajes: 189
Antigüedad: 19 años
Puntos: 0
Respuesta: Gestion de errores mysql

Encontré una solución:

Código vb:
Ver original
  1. Private Sub Form_Load()
  2. On Error GoTo Gestionaerror
  3. Show
  4. Dim i As Integer
  5. i = Rnd * 10 ^ 6    '[Esta línea genera el error]
  6. Print "La ejecución continúa aquí debido al Resume Next"
  7. Print i    '[Devuelve cero ya que fue imposible asignarle valor tipo integer]
  8. Gestionaerror:
  9. If Err.Number <> 0 Then
  10.     GestiónError
  11.     Resume Next
  12. End If
  13. End Sub
  14.  
  15. Private Sub GestiónError()
  16. MsgBox("Se ha producido un error. Tipo de error = " & Err.Number & ". Descripción: " & Err.Description)
  17. End Sub

Referencia: http://www.aprenderaprogramar.com/in...l-iq&Itemid=61