Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Item not found error again!

Author  Topic 

Nitu
Yak Posting Veteran

81 Posts

Posted - 2006-04-13 : 10:36:11
I am getting this error:


ADODB.Recordset error '800a0cc1'

Item cannot be found in the collection corresponding to the requested name or ordinal.


when i run this following code:

-------------------------------------
stored procedure
------------------------------------
create spupdaterecords
@input1 int
as
Declare @errormessage nvarchar(50)
Declare @tabcount int
Declare @tabcount1 int

set @errormessage = ''

if @input = 1
begin
update table set field = -1

delete table1 where field = 1
end

select @tabcount = count(*) from table1
select @tabcount1 = count(*) from table

if @tabcount <> @tabcount1
Set @errormessage = 'failed'
else
Set @errormessage = 'successful'


select @errormessage as errormessage

Go

------------------------------------------------
asp
------------------------------------------------

set rs = createobject("adodb.recordset")
sql = "spupdaterecords 1"
rs.open sql, conn

response.write rs("errormessage")



Can someone please tell me where iam wrong.


Thanks in advance,
Nitu

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-04-13 : 10:44:24
[code]create spupdaterecords
@input1 int
as
Declare @errormessage nvarchar(50)
Declare @tabcount int
Declare @tabcount1 int

set @errormessage = ''

if @input = 1[/code]


Check the Parameter Name

Srinika
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-04-13 : 22:48:44
if you're going to do it that way in your sp,

use rs.fields(0) instead

quote:

response.write rs("errormessage")



--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -