Visual Basic - Ayuda con un recorset que no se quiere abrir

Life is soft - evento anual de software empresarial
 
Vista:

Ayuda con un recorset que no se quiere abrir

Publicado por Angela (97 intervenciones) el 20/01/2003 18:26:32
HOLA
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