Código:
Ese mismo codigo estoy utilizando para hacer la consulta en accessy si funciona.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
Gracias por todo y salu2