ADODB.Parameter error '800a0d5d'

I have the following stored procedure and beloow it I have a piece of the ASP file that calls it.
This is the error I get:
ADODB.Parameter error '800a0d5d'

Application uses a value of the wrong type for the current operation.

/pp/processTRequest.asp, line 62

ALTER PROCEDURE [dbo].[sp_insUserInfo]
      -- Parameters for 'tbl_user'
      @personnel_id int,
      @fname varchar(50),
      @lname varchar(50),
      @username varchar(50),
      @pwd varchar(50),
      @role_ID int,
      @email_addr varchar(70)
      
AS
      DECLARE @dte_added datetime

BEGIN
      -- SET NOCOUNT ON added to prevent extra result sets from
      -- interfering with SELECT statements.
      SET NOCOUNT ON;

      SET @dte_added = GETDATE()

      INSERT INTO tbl_user(personnel_id,fname,lname,username,pwd,role_id,email_addr,dte_added) VALUES(@personnel_id,@fname,@lname,@username,@pwd,@role_ID,@email_addr,@dte_added)            
      
      --return SCOPE_IDENTITY()
END



'=============================================
'Stored Procedure - sp_insUserInfo
'=============================================
    Set cmd = server.CreateObject("ADODB.Command")
    WITH cmd
      .ActiveConnection = Conn
      .CommandText = "sp_insUserInfo"
      .CommandType = adCmdStoredProc
      .Parameters(1).Value = session("pid")
      .Parameters(2).Value = session("firstname")
      .Parameters(3).Value = session("lastname")
      .Parameters(4).Value = session("username")
      .Parameters(5).Value = session("password")
      .Parameters(6).Value = session("roleID")
      .Parameters(7).Value = session("email")        <--  Line 62
      .execute()
    END WITH

When I take out line 62 and comment it out of my SP, I don't get an error.
what am I doing wrong?
Thanks.
LVL 5
IsaacSharePoint Client Side DeveloperAsked:
Who is Participating?
 
patriktConnect With a Mentor Commented:
You didn't show definition of your ADO Parameter object. If you define it somewhere check its ADO datatype. If you don't define it you should do it because without definition of datatype it will be "infered" from value and so can be wrong.

Create new Parameter object wioth strict definition.

Patrik
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.