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.