Ver Mensaje Individual
  #10 (permalink)  
Antiguo 13/05/2010, 19:29
franko1809
 
Fecha de Ingreso: enero-2008
Ubicación: Lima - Perú
Mensajes: 1.127
Antigüedad: 16 años, 10 meses
Puntos: 10
Respuesta: error de complicion: Procedimiento demasiado largo

Que tal codigo menos mal que lo solucionaste.
Código vb:
Ver original
  1. login.C7 = Combo7.Text
  2. For i = o To 9
  3.     List1(i).Clear
  4. Next
  5.  
  6. If Not IsNull(DTPicker1.Value) And login.C4 <> "" And login.C5 <> "" And login.C6 <> "" And login.C7 <> "" Then
  7.    If login.est = True Then
  8.       login.rst.Close
  9.    Else
  10.    End If
  11.  
  12.    login.SQL = "SELECT DISTINCT * FROM requerimiento where numero = '" + login.C4 + "' and sucursal '" + login.C5 + "' and depto = '" + login.C6 + "' and funcionario = '" + login.C7 + "' fecha = '" & DTPicker1.Value & "'and estado = '" + login.val + "'"
  13.    login.rst.Open login.SQL, login.cnn, adOpenDynamic, adLockOptimistic
  14.    While login.rst.EOF = False
  15.      List1(0).AddItem login.rst(0)
  16.      login.rst.MoveNext
  17.    Wend
  18.    login.rst.Close
  19.  
  20.    login.SQL = "SELECT DISTINCT * FROM requerimiento where numero = '" + login.C4 + "' and sucursal '" + login.C5 + "' and depto = '" + login.C6 + "' and funcionario = '" + login.C7 + "' fecha = '" & DTPicker1.Value & "'and estado = '" + login.val + "'"
  21.    login.rst.Open login.SQL, login.cnn, adOpenDynamic, adLockOptimistic
  22.    While login.rst.EOF = False
  23.      List1(1).AddItem login.rst(1)
  24.      login.rst.MoveNext
  25.    Wend
  26.    login.rst.Close
  27.  
  28.    login.SQL = "SELECT DISTINCT * FROM requerimiento where numero = '" + login.C4 + "' and sucursal '" + login.C5 + "' and depto = '" + login.C6 + "' and funcionario = '" + login.C7 + "' fecha = '" & DTPicker1.Value & "'and estado = '" + login.val + "'"
  29.    login.rst.Open login.SQL, login.cnn, adOpenDynamic, adLockOptimistic
  30.    While login.rst.EOF = False
  31.      List1(2).AddItem login.rst(2)
  32.      login.rst.MoveNext
  33.    Wend
  34.    login.rst.Close
  35.  
  36.    login.SQL = "SELECT DISTINCT * FROM requerimiento where numero = '" + login.C4 + "' and sucursal '" + login.C5 + "' and depto = '" + login.C6 + "' and funcionario = '" + login.C7 + "' fecha = '" & DTPicker1.Value & "'and estado = '" + login.val + "'"
  37.    login.rst.Open login.SQL, login.cnn, adOpenDynamic, adLockOptimistic
  38.    While login.rst.EOF = False
  39.      List1(3).AddItem login.rst(3)
  40.      login.rst.MoveNext
  41.    Wend
  42.    login.rst.Close
  43.  
  44.    login.SQL = "SELECT DISTINCT * FROM requerimiento where numero = '" + login.C4 + "' and sucursal '" + login.C5 + "' and depto = '" + login.C6 + "' and funcionario = '" + login.C7 + "' fecha = '" & DTPicker1.Value & "'and estado = '" + login.val + "'"
  45.    login.rst.Open login.SQL, login.cnn, adOpenDynamic, adLockOptimistic
  46.    While login.rst.EOF = False
  47.      List1(4).AddItem login.rst(4)
  48.      login.rst.MoveNext
  49.    Wend
  50.    login.rst.Close
  51.  
  52.    login.SQL = "SELECT DISTINCT * FROM requerimiento where numero = '" + login.C4 + "' and sucursal '" + login.C5 + "' and depto = '" + login.C6 + "' and funcionario = '" + login.C7 + "' fecha = '" & DTPicker1.Value & "'and estado = '" + login.val + "'"
  53.    login.rst.Open login.SQL, login.cnn, adOpenDynamic, adLockOptimistic
  54.    While login.rst.EOF = False
  55.      List1(5).AddItem login.rst(5)
  56.      login.rst.MoveNext
  57.    Wend
  58.    login.rst.Close
  59.  
  60.    login.SQL = "SELECT DISTINCT * FROM requerimiento where numero = '" + login.C4 + "' and sucursal '" + login.C5 + "' and depto = '" + login.C6 + "' and funcionario = '" + login.C7 + "' fecha = '" & DTPicker1.Value & "'and estado = '" + login.val + "'"
  61.    login.rst.Open login.SQL, login.cnn, adOpenDynamic, adLockOptimistic
  62.    While login.rst.EOF = False
  63.      List1(6).AddItem login.rst(6)
  64.      login.rst.MoveNext
  65.    Wend
  66.    login.rst.Close
  67.  
  68.    login.SQL = "SELECT DISTINCT * FROM requerimiento where numero = '" + login.C4 + "' and sucursal '" + login.C5 + "' and depto = '" + login.C6 + "' and funcionario = '" + login.C7 + "' fecha = '" & DTPicker1.Value & "'and estado = '" + login.val + "'"
  69.    login.rst.Open login.SQL, login.cnn, adOpenDynamic, adLockOptimistic
  70.    While login.rst.EOF = False
  71.      List1(7).AddItem login.rst(7)
  72.      login.rst.MoveNext
  73.    Wend
  74.    login.rst.Close
  75.  
  76.    login.SQL = "SELECT DISTINCT * FROM requerimiento where numero = '" + login.C4 + "' and sucursal '" + login.C5 + "' and depto = '" + login.C6 + "' and funcionario = '" + login.C7 + "' fecha = '" & DTPicker1.Value & "'and estado = '" + login.val + "'"
  77.    login.rst.Open login.SQL, login.cnn, adOpenDynamic, adLockOptimistic
  78.    While login.rst.EOF = False
  79.      List1(8).AddItem login.rst(8)
  80.      login.rst.MoveNext
  81.    Wend
  82.    login.rst.Close
  83.  
  84.    login.SQL = "SELECT DISTINCT * FROM requerimiento where numero = '" + login.C4 + "' and sucursal '" + login.C5 + "' and depto = '" + login.C6 + "' and funcionario = '" + login.C7 + "' fecha = '" & DTPicker1.Value & "'and estado = '" + login.val + "'"
  85.    login.rst.Open login.SQL, login.cnn, adOpenDynamic, adLockOptimistic
  86.    While login.rst.EOF = False
  87.      List1(9).AddItem login.rst(9)
  88.      login.rst.MoveNext
  89.    Wend
  90.  
  91. End If