← Foro de Visual Basic

BUSCAR ENTRE DOS CANTIDADES CON ADO

Hilo en el foro de Visual Basic · 03 de Junio del 2004 · 1 respuestas
davidcarcel03 de Junio del 2004
Pregunta
PERDONAR POR REPETIR LA CABEZERA, PERO AQUI OS PONGO EL FALLO QUE ME DA, Y NO SE POR QUE....SOLO ME FALTA REPARAR ESTE SISTEMA DE BUSQUEDA Y YA ESTA, POR FAVOR AYUDARME....COMO LO HAGO.

Private Sub Comm_Click()

sentencia = "select * from VENTAS where POBLACIONPRODUTO='" & Text2.Text & "'"
sentencia = sentencia & " and TIPOPRODUCTO='" & Text3.Text & "'"
sentencia = sentencia & " and importerequerido>='" & Text7.Text & "'"
sentencia = sentencia & " and importerequerido<='" & Text8.Text & "'"
Adodc1.RecordSource = sentencia
Adodc1.Refresh
' FALLO QUE ME DA: no coinciden los datos en la expresion de criterios.

End Sub

Respuestas 1

Sin nombre03 de Junio del 2004
supongo que da fallo pq quieres comparar datos de tipo texto por datos de tipo double o int
aber si esto te puede ayudar
pon lo siguiente:

Private Sub Comm_Click()

sentencia = "select * from VENTAS where POBLACIONPRODUTO=\'" & Text2.Text & "\'"
sentencia = sentencia & " and TIPOPRODUCTO=\'" & Text3.Text & "\'"
sentencia = sentencia & " and importerequerido>=\'" & cdbl(Text7.Text) & "\'"
sentencia = sentencia & " and importerequerido<=\'" & cdbl(Text8.Text) & "\'"
Adodc1.RecordSource = sentencia
Adodc1.Refresh
End Sub

¿Buscas más hilos como este? Mira el foro de Visual Basic o usa el buscador.