Hi i get this stupid error in my code on line marked in red
Operation is not allowed when the object is closed. (Just after i open the connection!)
-Gus
Operation is not allowed when the object is closed. (Just after i open the connection!)
Code:
Dim rs, cmd
Set rs = CreateObject("ADODB.Recordset")
Set cmd = CreateObject("ADODB.Command")
With cmd
.CommandText = "usp_HomeTopSeller"
.CommandType = adCmdStoredProc
.ActiveConnection = gConn
.Parameters.Append .CreateParameter("@RETURN_VALUE", adInteger, adParamReturnValue, 0)
.Parameters.Append .CreateParameter("@SiteID", adInteger, adParamInput, 0)
.Parameters("@SiteID") = gSiteID
End With
rs.Open cmd
[COLOR=red]If Not rs.EOF then[/color]
.......
Do While Not RS.EOF
.......
RS.MoveNext
Loop
End If
-Gus