Ver Mensaje Individual
  #5 (permalink)  
Antiguo 06/03/2006, 13:07
dark_night
 
Fecha de Ingreso: octubre-2004
Ubicación: chile
Mensajes: 116
Antigüedad: 19 años, 6 meses
Puntos: 0
Código:
Private Sub Buscar()
  Dim Sql As String
  
  If CboBuscar.Text = "CD" Then
    Sql = "SELECT * FROM DATOS where " & CboBuscar.Text & "=" & TxtBuscar.Text & " ORDER BY TITULO"
  Else
    Sql = "SELECT * FROM DATOS where " & CboBuscar.Text & "='" & TxtBuscar.Text & "' ORDER BY TITULO"
  End If
  
  Set trs = cnn.Execute(Sql)
  
  With trs
    If (.BOF And .EOF) Then
        MsgBox "No se encontro el Registro Buscado"
    Else
        ListView1.ListItems.Clear
        .MoveFirst
        Do While Not .EOF
            Set tli = ListView1.ListItems.Add(, , .Fields("CD") & "")
            tli.SubItems(1) = .Fields("Autor") & ""
            tli.SubItems(2) = .Fields("TITULO") & ""
            tli.SubItems(3) = .Fields("PORTADA") & ""
            .MoveNext
        Loop
    End If
  End With
End Sub
asi obtengo los datos y los coloco en el listview