Public Sub buscador_Activate()
Dim i As Integer
'Busqueda exacta' COMENTADA LA BUSQUEDAD EXACTA POR SER TAN MALA XD
'If bs.Value = True Then
'rs = cn.Exec("select * from iventario where nombre_m = '" & buscador.Text & "';")
' tiv.Clear
'tiv.Rows.Count = rs.Count
'For i = 0 To (rs.Count - 1)
' tiv[i, 0].Text = rs["codigo"]
' tiv[i, 1].Text = rs["nombre_m"]
' tiv[i, 2].Text = rs["presentacion_m"]
'tiv[i, 3].Text = rs["cantidadm"]
'rs.Movenext
'Next
'Endif
'FIN
'Busquedad por letra o letras'
If bl.Value = True Then
rs = cn.Exec("select * from iventario where nombre_m LIKE '" & buscador.Text & "%" "';")
tiv.Clear
tiv.Rows.Count = rs.Count
For i = 0 To (rs.Count - 1)
tiv[i, 0].Text = rs["codigo"]
tiv[i, 1].Text = rs["nombre_m"]
tiv[i, 2].Text = rs["presentacion_m"]
tiv[i, 3].Text = rs["cantidadm"]
rs.Movenext
Next
Endif
'FIN'
'Busquedad Por cualquier letra'
If bcp.Value = True Then
rs = cn.Exec("select * from iventario where nombre_m LIKE '" "%" & buscador.Text & "%" "';")
tiv.Clear
tiv.Rows.Count = rs.Count
For i = 0 To (rs.Count - 1)
tiv[i, 0].Text = rs["codigo"]
tiv[i, 1].Text = rs["nombre_m"]
tiv[i, 2].Text = rs["presentacion_m"]
tiv[i, 3].Text = rs["cantidadm"]
rs.Movenext
Next
Endif
'FIN'
buscador.Text = ""
End
Dim i As Integer
'Busqueda exacta' COMENTADA LA BUSQUEDAD EXACTA POR SER TAN MALA XD
'If bs.Value = True Then
'rs = cn.Exec("select * from iventario where nombre_m = '" & buscador.Text & "';")
' tiv.Clear
'tiv.Rows.Count = rs.Count
'For i = 0 To (rs.Count - 1)
' tiv[i, 0].Text = rs["codigo"]
' tiv[i, 1].Text = rs["nombre_m"]
' tiv[i, 2].Text = rs["presentacion_m"]
'tiv[i, 3].Text = rs["cantidadm"]
'rs.Movenext
'Next
'Endif
'FIN
'Busquedad por letra o letras'
If bl.Value = True Then
rs = cn.Exec("select * from iventario where nombre_m LIKE '" & buscador.Text & "%" "';")
tiv.Clear
tiv.Rows.Count = rs.Count
For i = 0 To (rs.Count - 1)
tiv[i, 0].Text = rs["codigo"]
tiv[i, 1].Text = rs["nombre_m"]
tiv[i, 2].Text = rs["presentacion_m"]
tiv[i, 3].Text = rs["cantidadm"]
rs.Movenext
Next
Endif
'FIN'
'Busquedad Por cualquier letra'
If bcp.Value = True Then
rs = cn.Exec("select * from iventario where nombre_m LIKE '" "%" & buscador.Text & "%" "';")
tiv.Clear
tiv.Rows.Count = rs.Count
For i = 0 To (rs.Count - 1)
tiv[i, 0].Text = rs["codigo"]
tiv[i, 1].Text = rs["nombre_m"]
tiv[i, 2].Text = rs["presentacion_m"]
tiv[i, 3].Text = rs["cantidadm"]
rs.Movenext
Next
Endif
'FIN'
buscador.Text = ""
End
Aqui les dejo la documentación con la cual me guie
http://dev.mysql.com/doc/refman/5.0/es/pattern-matching.html
Tambien pienso implementar este tipo de busqueda: http://dev.mysql.com/doc/refman/5.0/es/fulltext-search.html pero cuando lo implemente les dejo el codigo jeje
Al parecer el LIKE, se queda atras... la busquedad Full Text es muy buena! http://www.fabio.com.ar/959