Are you calling the *same* sproc over and over?

If so, create/append the parameter outside the loop, and just assign a value
inside the loop:

<%
With objCommand
    .Parameters.Append .CreateParameter("@ParamName", adInteger,
adParamInput, 4)
End With

For i = 1 to 10
    objCommand.Parameters("@ParamName").Value = i
    objCommand.Execute
Next
%>

Cheers
Ken


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Daniel Field" <[EMAIL PROTECTED]>
To: "ActiveServerPages" <[EMAIL PROTECTED]>
Sent: Friday, September 20, 2002 10:20 PM
Subject: RE: Clearing SP parameters


: Cheers! That will do the job nicely!!
:
: -----Original Message-----
: From: Scott [mailto:[EMAIL PROTECTED]]
: Sent: Friday, September 20, 2002 13:26
: To: ActiveServerPages
: Subject: Re: Clearing SP parameters
:
:
: hey Daniel
:
: I have a little sub in my global file that might do the trick?
:
: sub ClearCmdParams(ACmd)
:   do until ACmd.Parameters.Count = 0
:     ACmd.Parameters.Delete(ACmd.Parameters.Count-1)
:   loop
: end sub
:
: cheers
:
:
: ----- Original Message -----
: From: "Daniel Field" <[EMAIL PROTECTED]>
: To: "ActiveServerPages" <[EMAIL PROTECTED]>
: Sent: Friday, September 20, 2002 9:25 PM
: Subject: Clearing SP parameters
:
:
: : Hi All,
: :
: : I have a script that loops through a recordset calling a Stored
Procedure
: : each time like:
: :
: :
: : Set oCmd = CreateObject("ADODB.Command")
: : oCmd.CommandType = &H0004
: : oCmd.CommandText = "MY STORE PROCEDURE"
: : oCmd.ActiveConnection = myconnection
: :
: :
: : Do while [statement]
: :
: : oCmd.Parameters.Append
: :
:
oCmd.CreateParameter("@fullXML",adLongVarChar,adParamInput,Len(fullXML)+1,fu
: : llXML)
: :
: : oCmd.Execute ,,adExecuteNoRecords
: :
: : Loop
: :
: : What is the best way of clearing the parameters each loop?  I am
currently
: : set the oCmd object to nothing and recreating it each loop, but I know
: this
: : is not the best way of doing it!
: :
: : Thanks,
: :
: : Dan



---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to