Visual Basic - ERROR CON SENTENCIA

Life is soft - evento anual de software empresarial
 
Vista:

ERROR CON SENTENCIA

Publicado por jeanette (4 intervenciones) el 03/11/2002 20:40:05
hOLA AMIGOS DEL FORO SABEn TENGO UN SUPER PROBLEMA ESTOY TRATANDO DE MANIPULAR DATOS DE UNA BASE DE DATOS ACCES CON SENTENCIAS SQL Y ADO PERO QUIERO BUSCAR UN REGISTRO DE UNA TABLA POR ID Y ME SALE UN ERROR HAGO LO SGTE PARA QUE SE CUMPLA MI CONDICION que el campo rut_clie sea igual al rut ingreasado en la caja de texto txtrut

Set db = New ADODB.Connection
Set rs2= New ADODB.Recordset

sql = "select * from cliente WHERE rut_clie =' '" & txtrut & " ' "

RS.OPEN SQL , db

este es el error que me aparece
"NO COINCIDEN LOS TIPOS DE DATOS EN LA EXPRESION DE CRITERIOS"
que creen que hago mal?
byee
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

RE:ERROR CON SENTENCIA

Publicado por Felipe (8 intervenciones) el 03/11/2002 21:34:04
Si el campo de la base de datos es numérico, debes quitar la comilla simple. En lugar de escribir:
sql = "select * from cliente WHERE rut_clie =' '" & txtrut & " ' "
Debes escribir:
sql = "select * from cliente WHERE rut_clie =" & txtrut
Suerte
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar