Visual Basic - SOLO ES UN PROBLEMA DE RECORSET AYUDA PORFAVOR

Life is soft - evento anual de software empresarial
 
Vista:

SOLO ES UN PROBLEMA DE RECORSET AYUDA PORFAVOR

Publicado por Angela (97 intervenciones) el 24/01/2003 20:01:58
HOLA
OJALA ALGUIEN ME PUEDA AYUDAR O DAR UNA ORIENTACION PORFAVOR CON ESTE PROBLEMA:
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

RE:SOLO ES UN PROBLEMA DE RECORSET AYUDA PORFAVOR

Publicado por thetony (5 intervenciones) el 25/01/2003 05:36:38
en la linea

Set cnm.ActiveConnection = cn

debes haber abierto primeramente la conexion cn en caso contrario
de da el error que especificas.
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