Thanks for the help to those who responded.  It turns out that the
problem was that I was not specifying the size of the varchar
parameters when I called the CreateParameter method.  The SP executes
fine now.

It's nice that Microsoft chose to use a nice helpful error message
for this particular situation.  Riiiight... ;-)

-- Ross

--- Venu Gopal <[EMAIL PROTECTED]> wrote:
> Hi Ross,
>  
>   Look at the stored procedure definition and see if there are any
> fields which are used in SP and missing in database (Spelling
> Mistake, or the field is deleted recently)... you may want to send
> the stored procedure definition and the structure of all the tables
> used in the stored procedure..
>  
> Venu
> 
> "Ross St. Clair" <[EMAIL PROTECTED]> wrote:
> I'm getting a strange error while attempting to execute a stored
> procedure via ADO. I can't figure it out for the life of me and
> I've
> looked all over the place for a solution, but nothing has helped or
> really applied to this situation. I'm hoping someone here has an
> idea. The error I'm getting is "Item cannot be found in the
> collection corresponding to the requested name or ordinal" and is
> occurring on the line I marked in the code below. Is it possible
> there is something in the stored procedure's code that is causing
> this error? I didn't write the SP, but it works fine from Query
> Analyzer. Thanks for your help!
> 
> -- Ross St. Clair
> 
> CODE:
> -----
> Set cmdCommitMetric = Server.CreateObject("ADODB.Command")
> cmdCommitMetric.ActiveConnection = connMain
> cmdCommitMetric.CommandText = "sp_MM_Alert_Insert"
> cmdCommitMetric.CommandType = adCmdStoredProc
> 
> cmdCommitMetric.Parameters.Append
> cmdCommitMetric.CreateParameter("@Name", adVarChar, adParamInput)
> cmdCommitMetric.Parameters.Append
> cmdCommitMetric.CreateParameter("@UMKey", adInteger, adParamInput)
> cmdCommitMetric.Parameters.Append
> cmdCommitMetric.CreateParameter("@CDays", adInteger, adParamInput)
> cmdCommitMetric.Parameters.Append
> cmdCommitMetric.CreateParameter("@WDays", adInteger, adParamInput)
> cmdCommitMetric.Parameters.Append
> cmdCommitMetric.CreateParameter("@NDays", adInteger, adParamInput)
> cmdCommitMetric.Parameters.Append
> cmdCommitMetric.CreateParameter("@Flg", adVarChar, adParamInput)
> 
> cmdCommitMetric.Parameters("@Name").Value = sAlertName
> cmdCommitMetric.Parameters("@UMKey").Value = CLng(sUserMetricKey)
> cmdCommitMetric.Parameters("@CDays").Value = lCriticalAlertDays
> cmdCommitMetric.Parameters("@WDays").Value = lWarningAlertDays
> cmdCommitMetric.Parameters("@NDays").Value = lNormalAlertDays
> cmdCommitMetric.Parameters("@Flg").Value = sAlertEnabled
> 
> Set rsCommitMetric = cmdCommitMetric.Execute
> ^^^ ERROR OCCURS AS A RESULT OF THIS LINE ^^^
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> 
> 
>
---------------------------------------------------------------------
> 
> Home : http://groups.yahoo.com/group/active-server-pages
>
---------------------------------------------------------------------
> Post : [EMAIL PROTECTED]
> Subscribe : [EMAIL PROTECTED]
> Unsubscribe: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
>               
> ---------------------------------
> Do you Yahoo!?
> Friends.  Fun. Try the all-new Yahoo! Messenger
> 
> [Non-text portions of this message have been removed]
> 
> 
> 
> 
> ------------------------ Yahoo! Groups Sponsor
> --------------------~--> 
> Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
> Now with Pop-Up Blocker. Get it for free!
> http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/17folB/TM
>
--------------------------------------------------------------------~->
> 
> 
>
---------------------------------------------------------------------
>    
>  Home       : http://groups.yahoo.com/group/active-server-pages
>
---------------------------------------------------------------------
>  Post       : [EMAIL PROTECTED]
>  Subscribe  : [EMAIL PROTECTED]
>  Unsubscribe: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
> 
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 



        
                
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/17folB/TM
--------------------------------------------------------------------~-> 

---------------------------------------------------------------------    
 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [EMAIL PROTECTED]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
--------------------------------------------------------------------- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/active-server-pages/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 

Reply via email to