Non initialized Cmd Parameter Collection via ASP vs SQL Server 200


I have some ancient VBScript code running in ASP 3.0. In our development
area the code runs well, but at our customers server it fails claiming that
the parameter collection is not initialized. (IE. index out of range)
The stuff has run fine on SQL Server 2000 before, but the customer has
upgraded to SQL Server 2005.
They haven't upgraded to SP 1 or 2 yet, but I'm not entirely sure that is
the reason.

Any other possible reasons why the following code won't pre-populate the
parameters collection with return value and one input parameter?
(I use storedproc = 4, "myProcedureName", "myConnection", Array(string) as
parameters here)
Of course it fails on Set oRetPm = oCmd.Parameters(0) since I have handled
the following statements. And the procedure has both return and parameter. ;)

function runCommand(nCommandType, sCommandText, vConn, aParameters, byref
dim oCmd
dim oRetPm
dim i

runCommand = false

Set oCmd = Server.CreateObject("ADODB.Command")
if isObject(vConn) then
Set oCmd.ActiveConnection = vConn
oCmd.ActiveConnection = vConn
end if

oCmd.CommandType = nCommandType
oCmd.CommandText = sCommandText

Set oRetPm = oCmd.Parameters(0)
if isArrayInited(aParameters) then
for i = 0 to ubound(aParameters)
Response.Write "<!-- " & oCmd.Parameters(i + 1).Name & " : " &
aParameters(i) & " -->" & vbCrLf
on error resume next
oCmd.Parameters(i + 1).Value = aParameters(i)
if Err.number <> 0 then
Response.Write "<!-- " & Err.description & " -->"
Set oCmd = nothing
runCommand = false
exit function
end if
on error goto 0
end if


Relevant Pages

  • Re: ASP date problems.
    ... the customers server is setup all that well. ... assembly what culture info you want to work with when you use a format ... This lets Microsoft do the culture conversion. ...
  • Re: Webservices references
    ... i cant see the IP ... address as its a server out on site. ... but how do you reference the customers server which is on-site and has the ...
  • Re: Webservices References
    ... address as its a server out on site. ... but how do you reference the customers server which is on-site and has the ... > is there a way around this or do u just overwrite every instance of the IP ...
  • Re: ASP .NET website deployment
    ... "Josh" wrote:> Hi Roberto, ... > 1) Copy all of the all of the files accross tot eh web server> rembering to keep the same file structure that you have created on you> testing server. ... >> I build an ASP .NET web site using VB.NET the website works perfect in my> computer. ... >> I copied all the files inside my virtual directory and copy them to the> wwwroot of my customers server. ...