Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > ADO Data > Non initialized...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 22 Topic 4232 of 4320
Post > Topic >>

Non initialized Cmd Parameter Collection via ASP vs SQL Server 200

by =?Utf-8?B?TGFycy1Fcmlr?= <lars-erik@[EMAIL PROTECTED] > May 13, 2008 at 01:41 AM

Hi!

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 
vRetVal)
dim oCmd
dim oRetPm
dim i

	runCommand = false

	Set oCmd = Server.CreateObject("ADODB.Command")
	if isObject(vConn) then
		Set oCmd.ActiveConnection = vConn
	else
		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
		next
	end if

-- 
Lars-Erik
 




 22 Posts in Topic:
Non initialized Cmd Parameter Collection via ASP vs SQL Server 2
=?Utf-8?B?TGFycy1Fcmlr?=   2008-05-13 01:41:01 
RE: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
stcheng@[EMAIL PROTECTED]  2008-05-14 08:12:53 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
"Bob Barrows [MVP]&q  2008-05-14 07:05:47 
RE: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
=?Utf-8?B?TGFycy1Fcmlr?=   2008-05-14 04:14:00 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
"Bob Barrows [MVP]&q  2008-05-14 07:50:36 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
=?Utf-8?B?TGFycy1Fcmlr?=   2008-05-14 05:59:01 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
"Bob Barrows [MVP]&q  2008-05-14 09:08:04 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
=?Utf-8?B?TGFycy1Fcmlr?=   2008-05-14 06:14:01 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
"Bob Barrows [MVP]&q  2008-05-14 09:21:48 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
=?Utf-8?B?TGFycy1Fcmlr?=   2008-05-14 06:32:01 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
=?Utf-8?B?TGFycy1Fcmlr?=   2008-05-14 06:17:01 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
"Bob Barrows [MVP]&q  2008-05-14 09:40:38 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
=?Utf-8?B?TGFycy1Fcmlr?=   2008-05-14 06:50:00 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
stcheng@[EMAIL PROTECTED]  2008-05-15 04:17:11 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
=?Utf-8?B?TGFycy1Fcmlr?=   2008-05-15 03:17:00 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
"Bob Barrows [MVP]&q  2008-05-15 07:01:08 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
=?Utf-8?B?TGFycy1Fcmlr?=   2008-05-15 06:05:01 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
stcheng@[EMAIL PROTECTED]  2008-05-16 02:30:44 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
"Bob Barrows [MVP]&q  2008-05-15 09:33:41 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
"Bob Barrows [MVP]&q  2008-05-15 18:09:40 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
"Bob Barrows [MVP]&q  2008-05-14 09:45:30 
Re: Non initialized Cmd Parameter Collection via ASP vs SQL Serv
=?Utf-8?B?TGFycy1Fcmlr?=   2008-05-14 06:58:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 14:10:42 CST 2008.