Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/12/2005, 00:53
jpvm
 
Fecha de Ingreso: mayo-2004
Ubicación: Cartago
Mensajes: 58
Antigüedad: 20 años
Puntos: 0
Consultas Sensitivas En Mysql

Estoy haciendo una consulta sensitiva a una base de datos en mysql desde vb, lo raro es que siempre que escribo la palabra o letra me pone que no existe ningun apellido en la bd que empiece con ese nombre, lo más raro es que lo probe el codigo en una bd en access y si funciona a la perfeccion pero a la hora de hacerla en la bd en mysql no me funciona

Código:
Public Sub confgrid()
grid.Clear
With grid
   .Cols = 7
   .Rows = 2
   
   .ColWidth(0) = 500
   .ColWidth(1) = 1000
   .ColWidth(2) = 1500
   .ColWidth(3) = 1000
   .ColWidth(4) = 2500
   .ColWidth(5) = 2500
   .ColWidth(6) = 2500
   
   
   
   .TextMatrix(0, 0) = "#"
   .TextMatrix(0, 1) = "Cédula"
   .TextMatrix(0, 2) = "Nombre"
   .TextMatrix(0, 3) = "Apellido"
   .TextMatrix(0, 4) = "Telefono"
   .TextMatrix(0, 5) = "Dirección"
   .TextMatrix(0, 6) = "E-mail"
   
   .Col = 0
   .Row = 1
   .ColSel = .Cols - 1
   
End With
End Sub

Private Sub txtape_KeyUp(KeyCode As Integer, Shift As Integer)
Dim LETRA As String

Dim ape As String
ape = txtape.Text
LETRA = ape
Me.confgrid
cmd.CommandText = "Select * From Clientes where  Apellido Like ('" & LETRA & "' & '%');"

Set rs = cmd.Execute
With grid

cont = 1

If Not rs.EOF Then
While Not rs.EOF

   
      cont = .Rows - 1
   
           .TextMatrix(cont, 0) = cont
           .TextMatrix(cont, 1) = rs(0)
           .TextMatrix(cont, 2) = rs(1)
           .TextMatrix(cont, 3) = rs(2)
           .TextMatrix(cont, 4) = rs(3)
           .TextMatrix(cont, 5) = rs(4)
           .TextMatrix(cont, 6) = rs(5)
'            .TextMatrix(cont, 7) = rs(6)
           .Rows = .Rows + 1
           rs.MoveNext
       Wend
   .Col = 0
   .Row = 1
   .ColSel = .Cols - 1
   
   Else
       MsgBox "No existen clientes que empiezen con: " & LETRA, vbCritical
       End If
       End With
End Sub
Ese mismo codigo estoy utilizando para hacer la consulta en accessy si funciona.

Gracias por todo y salu2