Visual Basic - ERROR:NO ES VALIDA SI EL OBJETO ESTA CERRADO

Life is soft - evento anual de software empresarial
 
Vista:

ERROR:NO ES VALIDA SI EL OBJETO ESTA CERRADO

Publicado por Angela (97 intervenciones) el 17/01/2003 22:36:40
HOLA
QUISIERA QUE ME AYUDARAN PORFAVOR CON ESTE ERROR APARENTEMENTE ESTA TODO BIEN PORQUE ME MARCA ESTE ERROR "LA OPERACION SOLICITADA POR LA APLICACION NO ESTA PERMITIDA SI EL OBJETO ESTA CERRADO" Y APARECE EN ESTA LINEA : While (Not res.EOF)
Y ESTE ES MI CODIGO,previamente declare los objetos y la conexion:
OJALA ME PUEDAN ORIENTAR , MUCHAS GRACIAS POR SU ATENCION.
Private Sub Command5_Click()
iscita = InputBox("Introduzca la cita", "Añadir cita")
If iscita <> "" Then
Set res = New ADODB.Recordset
Set cnm = New ADODB.Command
Set PARAMETRO = New ADODB.Parameter
Set cnm.ActiveConnection = cn
cnm.CommandText = "spcliente"
cnm.CommandType = adCmdStoredProc
cnm.Parameters.Append cnm.CreateParameter("cita", adVarChar, adParamInput, 10, iscita)
Set res = cnm.Execute()
Set FLDS = res.Fields
res.Open "nombre_bus " & iscita, cn, adOpenForwardOnly, adLockReadOnly
While (Not res.EOF)
For Each fld In FLDS
Debug.Print fld.Value
Next
Debug.Print ""
res.MoveNext
Wend
res.Close
cn.Close
End If
End Sub
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

NO ES VALIDA SI EL OBJETO ESTA CERRADO

Publicado por J2ML (464 intervenciones) el 22/01/2003 14:13:02
Oye en realidad veo tu código bastante depurado sólo se e ocurre que en la línea:
res.Open "nombre_bus " & iscita, cn, adOpenForwardOnly, adLockReadOnly
preguntarte que es "nombre_bus "&iscita un campo ? una tabla ? te recomendaría más bien emplear un Select....
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