Ver Mensaje Individual
  #6 (permalink)  
Antiguo 16/02/2005, 13:22
Avatar de Skalitiko
Skalitiko
 
Fecha de Ingreso: febrero-2005
Mensajes: 81
Antigüedad: 20 años, 2 meses
Puntos: 0
Los 10 números que ingresas, los ingresas en textbox a parte, en un solo testtbox separado por un caracter, en un listbox, un combo, etc...?.

Suponiendo que ingresas los números separados por "," en un solo textbox y que utilizas Access

Private Cnn As New ADODB.Connection
Private Sub Command1_Click()
Dim rst As New ADODB.Recordset
Dim sql As String
Dim Id As Long


With rst
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
sql = "select * from clientes where instr('" & Text1.Text & "',nro1) and "
sql = sql & "instr('" & Text1 & "',nro2) and instr('" & Text1 & "',nro3)"
.Source = sql
Set .ActiveConnection = Cnn
.Open
If Not .EOF And Not .BOF Then
.MoveFirst
While Not .EOF
UpdateCliente !Id
.MoveNext
Wend
.Close
sql = "select * from clientes where gano = true"
.Source = sql
.Open
Set Flex1.Recordset = rst
Flex1.Refresh

End If


End With
End Sub
Private Sub UpdateCliente(Id As Long)
Dim sql As String
sql = "Update Clientes set gano = true where id = " & Id
Cnn.Execute (sql)
End Sub
Private Sub Form_Load()
Cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\My Documents\Cojones.mdb;Persist Security Info=False"
Cnn.Open

End Sub

PD: La grilla que utilizo en este ejemplo es la Microsof Hierarchical FlexGrid Contrl 6.0