Visual Basic - BUSQUEDA MULTIPLE

Life is soft - evento anual de software empresarial
 
Vista:

BUSQUEDA MULTIPLE

Publicado por JULIO ESCOBAR (12 intervenciones) el 04/01/2001 00:00:00
AMIGOS: NECESITO DE SUS CONOCIMIENTOS YA QUE SOY INEXPERTO, TENGO UNA BASE DE DATOS EN ACCES (MDB) EL PROGRAMA HACE LA BUSQUEDA DE UN CAMPO PERO NECESITO HACER LA BUSQUEDA DE 2 CAMPOS, EJEMPLO:
LA BASE DE DATOS CONTIENE LOS CAMPOS NOMBRE, APELLIDO Y EDAD, EL PROGRAMA QUE TENGO HACE LA BUSQUEDA POR NOMBRE PERO PUEDEN EXISTIR MAS DE UN NOMBRE IGUAL ASI QUE QUIERO QUE BUSQUE POR EL CAMPO DEL NOMBRE Y APELLIDO, AGRADESCO DE ANTEMANO SU AYUDA.
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:BUSQUEDA MULTIPLE

Publicado por ft (16 intervenciones) el 05/01/2001 00:00:00
usa una select.
dim str as string
str=select * from tabla (la que sea) nombre (nombre del campo de la tabla)=´" & nombre(nombre o lugar donde se encuentre) & "´ and apellido=´" (igual antes) & apellido(igual antes)& "´"
set rs (variable de tipo recordset)= base.openrecordset (variable del tipo database) (str,dbopendynaset)
esto si esta usando visual basic con conexion ado a tu base de access.
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

RE:BUSQUEDA MULTIPLE

Publicado por Ariopolis (159 intervenciones) el 05/01/2001 00:00:00
Suponiendo que el nombre y el apellido los obtengas de cajas de texto (txtNombre y txtApellido), la sentencia select sería:

"select * from tabla where nombre=´" & txtNombre.Text & "´ and apellido=´" & txtApellido.Text & "´"

Para coincidencias parecidas utiliza el LIKE:

"select * from tabla where nombre like ´%" & txtNombre.Text & "%´ and apellido like ´%" & txtApellido.Text & "%´"

Con ADO valen los % y * como caracter comodín. Con DAO sólo los *.

Un saludo. Espero que sea lo que buscas.
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

RE:BUSQUEDA MULTIPLE

Publicado por tecniCam (220 intervenciones) el 05/01/2001 00:00:00
Ya te lo han contestado FT y ARIOPOLIS pero, si no es suficiente y/o quieres más sobre el asunto, entra en "visualia" pulsando abajo...
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