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)
 Error when executing storeprocedure.

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-03-26 : 10:45:02
Vinod writes "Error when executing storeprocedure.

The error which i have mentioned below i am getting only when i am using the ole db connectivity(SQLOLEDB). if i am using ODBC connectivity i am not getting the error, it is working fine.



error is:

Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/pnd/checkid.inc, line 7

--------------------------------------------
in my code the error line 7 is like this

Session("id") = SQLrs(0) ' this line i am getting error


-----------------------------------------------------------------
'this is my asp code

Dim SQLCon
Dim SQLcmd
Dim SQLrs
Dim SQLparam

Dim StrConnection

StrConnection = "provider=sqloledb;data source=test;initial catalog=testdb;user id=testuser;password=tstv1"

Set SQLCon = Server.CreateObject("ADODB.Connection")
Set SQLrs = Server.CreateObject("ADODB.Recordset")

SQLCon.Open StrConnection

Set SQLcmd = Server.CreateObject("ADODB.Command")
Set SQLcmd.ActiveConnection = SQLCon
SQLcmd.CommandType = 4

SQLcmd.CommandText = "dbo.Web_Start"
Set SQLrs = SQLcmd.execute

Session("id") = SQLrs(0) ' this line i am getting error

set SQLrs = nothing


-----------------------------------------------
my storeprocedure is


CREATE PROCEDURE dbo.Web_Start
AS
DECLARE @ErrorID INT
DECLARE @SessionID [CodeType]
SET @ErrorID = 2
SET @SessionID = NULL


EXEC Generate_SessionID @SessionID OUTPUT

SELECT @SessionID
IF @@ERROR = 0
RETURN 0
ELSE
RETURN @ErrorID


GO"
   

- Advertisement -