Visual Basic - ¿como busco un registro con ado?

Life is soft - evento anual de software empresarial
 
Vista:

¿como busco un registro con ado?

Publicado por juliana (6 intervenciones) el 21/09/2001 16:18:43
hola!

necesito ayuda con vb6.0 : 1.- indiquenme por favor como se hace la busqueda de un registro , he utilizado la instruccion find "campo de la tabla= variable dada por el usuario que se va a buscar "; no funciona cuando corro el programa aparece un mensaje indicando que hay un error de ejecucion en la variable dad por el usuario, y por tanto no trae el registro.
2.- como puedo cerrar un addnew que fue abierto anteriormente por error y que el usuario no lo quiere grabar. he tratado con la instruccion Cancelupdate, no lo graba pero aun así el codigo que es autonumerico

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:¿como busco un registro con ado?

Publicado por Renzo Roberto (22 intervenciones) el 21/09/2001 23:43:24
Private Sub BUSCAR()
Dim SCOD As String
SCOD = InputBox("Por Favor Ingrese el codigo de Promotor:", "BUSQUEDA")
If SCOD <> "" Then
RSDEM.MoveFirst 'RSDEM recorset con datos
RSDEM.Find "C_CODDEM='" + SCOD + "'"
If RSDEM.EOF Then
MsgBox "El Codigo no Existe", vbCritical, "MENASJE": Exit Sub
End If
text1=RSDEM(0)
text2=RSDEM(1)
text3=RSDEM(2)
text4=RSDEM(3)
End If
End Sub
Private Sub GRABAR()
If MsgBox("DESEA GRABAR", 36, "CONFIRMACION") = 7 Then
Call CANCELAR 'si es 7 entonces no grabas
RSDEM.Requery
Call DESHABILITAR
Exit Sub
End If
If TXTAPEDEM = "" Then
MsgBox "Ingrese Por Favor Un Apellido del Demostrador", vbCritical, "MENSAJE": TXTAPEDEM.SetFocus: Exit Sub
End If
If TXTNOMDEM = "" Then
MsgBox "Ingrese Por Favor Un Nombre del Demostrador", vbCritical, "MENSAJE": TXTNOMDEM.SetFocus: Exit Sub
End If
Call HABILITAR
TXTAPEDEM = Trim(UCase(Left(TXTAPEDEM, 1))) + Trim(LCase(Mid(TXTAPEDEM, 2, Len(TXTAPEDEM))))
TXTNOMDEM = Trim(UCase(Left(TXTNOMDEM, 1))) + Trim(LCase(Mid(TXTNOMDEM, 2, Len(TXTNOMDEM))))
CN.Execute "INSERT INTO DEMOSTRADOR VALUES('" + Trim(UCase(LBLCODDEM)) & "','" + Trim(TXTAPEDEM) & "','" & Trim(TXTNOMDEM) & "')"
Call CANCELAR
RSDEM.Requery: RSDEM.MoveLast
Cal
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:¿como busco un registro con ado?, Gracias, pero

Publicado por juliana (6 intervenciones) el 24/09/2001 22:14:31
no funciona [email protected], cuando corro el programa aparece un mensaje indicando que el objeto no reconoce la instruccion
RSDEM.Find "C_CODDEM='" + SCOD + "'" (adecuada a mi programa ).

gracias de antemano por todo lo que puedas hacer.
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

Hola Amigita

Publicado por Renzo Roberto (2 intervenciones) el 25/09/2001 04:49:09
Hola Jullisa:
Ya te mande la respuesta a tu email revisalo
Cualquier cosa me pasas la voz.
Posdata:
Respondeme para saber si te llego el email a [email protected]
Un Beso Renzo roberto
Desde Peru
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