Visual Basic - Problema con consulta a campo fecha

Life is soft - evento anual de software empresarial
 
Vista:

Problema con consulta a campo fecha

Publicado por Jose Arosquipa (1 intervención) el 15/05/2005 20:08:42
Hola Amigos

Tengo este problema, utilizo motor de BD de Mysql, tengo varios campos fechas, deseo realizar consultas a traves de ellos.

En el codigo me produce un error, alguien que me pueda dar la mano, gracias..

Private Function FechaSearch(xSearch As String) As Boolean
Dim rs As ADODB.Recordset
Dim sql As String
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseServer
sql = "select * from MyTable where fecha_inte = cdate('" & xSearch & "')"
rs.Open sql, conn, adOpenStatic, adLockReadOnly, adCmdText
If rs.EOF = True Then
rs.Close
Set rs = Nothing
Exit Function
End If
MsgBox (rs!fecha_inte)
If xSearch = rs!fecha_inte Then
Text1.Text = rs!CodigoID
Text2.Text = rs!chasis
Text3.Text = rs!svi
Text5.Text = rs!year_c
Text6.Text = rs!consignado
Text7.Text = rs!distribuidor
Text8.Text = rs!endosado
Text10.Text = rs!b_l
Text9.Text = rs!nave
Text11.Text = rs!fecha_nave
Text12.Text = rs!ceticos
Text13.Text = rs!fecha_inte
Text14.Text = rs!fecha_ins_r2
Text15.Text = rs!fecha_can_r2
Text16.Text = rs!fecha_emi_r2
Text17.Text = rs!agencia
Text18.Text = rs!fecha_ent_ag
Text19.Text = rs!fecha_pag_im
Text20.Text = rs!fecha_sal_r2
Text21.Text = rs!fecha_gui_re
Text24.Text = rs!impuesto
Text25.Text = rs!seguro
Text26.Text = rs!aplicacion
Text27.Text = rs!observacion
ShowImage Text1
'Text3.Text = Format(rs!svi, "######")
FechaSearch = True
Else
Limpia
FechaSearch = False
End If
rs.Close
Set rs = Nothing
End Function
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder