Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/04/2004, 08:26
medu50
 
Fecha de Ingreso: marzo-2004
Mensajes: 24
Antigüedad: 21 años
Puntos: 0
¿alguien puede decirme que le pasa a mi codigo?

Tengo el siguiente codigo y en la linea: Set tRs = cnn.Execute(sBuscar). Me da este error: "Error 13 en tiempo de ejecucion, NO COINCIDEN LOS TIPOS.

Private Sub CmdBuscar_Click()
Dim sBuscar As String
Dim tRs As Recordset
Dim tLi As ListItem
sBuscar = Text1
sBuscar = "SELECT * FROM CURSOS WHERE CURSO LIKE '" & sBuscar & "' ORDER BY CURSO"
Set tRs = cnn.Execute(sBuscar)
With tRs
If (.BOF And .EOF) Then
MsgBox "No se han encontrado los datos buscados"
Else
ListView1.ListItems.Clear
.MoveFirst
Do While Not .EOF
Set tLi = ListView1.ListItems.Add(, , .Fields("CURSO") & "")
tLi.SubItems(1) = .Fields("SUB_ACCION")
.MoveNext
Loop
End If
End With
End Sub

Tengo declarado tRs de tipo Recordset y no entiendo porque me puede dar este error, si alguien puede ayudarme... Muxas Gracias.