Problem with Stored Procedure inserting BIT value

I am working on the following Stored Procedure

USE [BlueDot]
GO
/****** Object:  StoredProcedure [dbo].[Addclientwebaccess]    Script Date: 10/27/2015 15:58:48 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO

ALTER PROCEDURE [dbo].[Addclientwebaccess]
    @Loginid VARCHAR(100) ,
    @Password VARCHAR(255) ,
    @Userid INT ,
    @Expdate DATE ,
    @Uploadocs BIT ,
    @Usefulinks BIT ,
    @client_personalprofile BIT ,
    @client_maincase BIT ,
    @client_relcases BIT ,
    @client_case_geninfo BIT ,
    @client_case_atty BIT ,
    @client_case_comments BIT ,
    @client_case_docs BIT ,
    @client_case_forms BIT ,
    @client_case_billing BIT ,
    @client_case_steps BIT,
    @firmid INT, 
    @Enable BIT, 
    @FirstTimeLogin BIT,
    @PermissionGroup NVARCHAR(50),
    @IsPswdEncrypted BIT,
    @IsLocked BIT,
    @IndvClientModule BIT
      
    
    
AS
    INSERT  INTO UserLogin
            ( LoginId ,
              Password ,
              UserId ,
              ExpDate ,
              Uploadocs ,
              Usefulinks ,
              client_personalprofile ,
              client_maincase ,
              client_relcases ,
              client_case_geninfo ,
              client_case_atty ,
              client_case_comments ,
              client_case_docs ,
              client_case_forms ,
              client_case_billing ,
              client_case_steps,
              FirmId,
              Enable,
              FirstTimeLogin,
              PermissionGroup,
              IsPswdEncrypted,
              IsLocked,
              IndvClientModule
            )
    VALUES  ( @Loginid ,
              @Password ,
              @Userid ,
              @Expdate ,
              @Uploadocs ,
              @Usefulinks ,
              @client_personalprofile ,
              @client_maincase ,
              @client_relcases ,
              @client_case_geninfo ,
              @client_case_atty ,
              @client_case_comments ,
              @client_case_docs ,
              @client_case_forms ,
              @client_case_billing ,
              @client_case_steps,
              @firmid,
              @Enable,
              @FirstTimeLogin,
              @PermissionGroup,
              @IsPswdEncrypted,
              @IsLocked,
              @IndvClientModule
             
            );

Open in new window


I am trying to insert the value '1'  into Uploadocs field but I get an error, this is my ASP code:

Dim SP_addwebaccess__Loginid
SP_addwebaccess__Loginid = "0"
if(Request.form("username")   <> "") then SP_addwebaccess__Loginid = Request.form("username")  

Dim SP_addwebaccess__Password
SP_addwebaccess__Password = "0"
if(EncrytPswd(RandomString())   <> "") then SP_addwebaccess__Password = EncrytPswd(RandomString())  

Dim SP_addwebaccess__Userid
SP_addwebaccess__Userid = "0"
if(Request.Querystring("NewUserID")   <> "") then SP_addwebaccess__Userid = Request.Querystring("NewUserID")  

Dim SP_addwebaccess__Expdate
SP_addwebaccess__Expdate = "01/01/2015"
if(Request.form("expireson")   <> "") then SP_addwebaccess__Expdate = Request.form("expireson")  

Dim SP_addwebaccess__Uploadocs
SP_addwebaccess__Uploadocs = ""
if((rs_defaccesrights.Fields.Item("Uploadocs").Value)   <> "") then SP_addwebaccess__Uploadocs = (rs_defaccesrights.Fields.Item("Uploadocs").Value)  

Dim SP_addwebaccess__Usefulinks
SP_addwebaccess__Usefulinks = "0"
if((rs_defaccesrights.Fields.Item("Usefulinks").Value)   <> "") then SP_addwebaccess__Usefulinks = (rs_defaccesrights.Fields.Item("Usefulinks").Value)  

Dim SP_addwebaccess__client_personalprofile
SP_addwebaccess__client_personalprofile = "0"
if((rs_defaccesrights.Fields.Item("PProfile").Value)   <> "") then SP_addwebaccess__client_personalprofile = (rs_defaccesrights.Fields.Item("PProfile").Value)  

Dim SP_addwebaccess__client_maincase
SP_addwebaccess__client_maincase = "0"
if((rs_defaccesrights.Fields.Item("MainCases").Value)   <> "") then SP_addwebaccess__client_maincase = (rs_defaccesrights.Fields.Item("MainCases").Value)  

Dim SP_addwebaccess__client_relcases
SP_addwebaccess__client_relcases = "0"
if((rs_defaccesrights.Fields.Item("RelCases").Value)   <> "") then SP_addwebaccess__client_relcases = (rs_defaccesrights.Fields.Item("RelCases").Value)  

Dim SP_addwebaccess__client_case_geninfo
SP_addwebaccess__client_case_geninfo = "0"
if((rs_defaccesrights.Fields.Item("CGeneralInfo").Value)   <> "") then SP_addwebaccess__client_case_geninfo = (rs_defaccesrights.Fields.Item("CGeneralInfo").Value)  

Dim SP_addwebaccess__client_case_atty
SP_addwebaccess__client_case_atty = "0"
if((rs_defaccesrights.Fields.Item("CAtty").Value)   <> "") then SP_addwebaccess__client_case_atty = (rs_defaccesrights.Fields.Item("CAtty").Value)  

Dim SP_addwebaccess__client_case_comments
SP_addwebaccess__client_case_comments = "0"
if((rs_defaccesrights.Fields.Item("CComments").Value)   <> "") then SP_addwebaccess__client_case_comments = (rs_defaccesrights.Fields.Item("CComments").Value)  

Dim SP_addwebaccess__client_case_docs
SP_addwebaccess__client_case_docs = "0"
if((rs_defaccesrights.Fields.Item("CDocs").Value)   <> "") then SP_addwebaccess__client_case_docs = (rs_defaccesrights.Fields.Item("CDocs").Value)  

Dim SP_addwebaccess__client_case_forms
SP_addwebaccess__client_case_forms = "0"
if((rs_defaccesrights.Fields.Item("CForms").Value)   <> "") then SP_addwebaccess__client_case_forms = (rs_defaccesrights.Fields.Item("CForms").Value)  

Dim SP_addwebaccess__client_case_billing
SP_addwebaccess__client_case_billing = "0"
if((rs_defaccesrights.Fields.Item("CBilling").Value)   <> "") then SP_addwebaccess__client_case_billing = (rs_defaccesrights.Fields.Item("CBilling").Value)  

Dim SP_addwebaccess__client_case_steps
SP_addwebaccess__client_case_steps = "0"
if((rs_defaccesrights.Fields.Item("CSteps").Value)   <> "") then SP_addwebaccess__client_case_steps = (rs_defaccesrights.Fields.Item("CSteps").Value)  

Dim SP_addwebaccess__firmid
SP_addwebaccess__firmid = "0"
if(Session("Firmid") <> "") then SP_addwebaccess__firmid = Session("Firmid")

Dim SP_addwebaccess__Enable
SP_addwebaccess__Enable = "0"
if("1" <> "") then SP_addwebaccess__Enable = "1"

Dim SP_addwebaccess__FirstTimeLogin
SP_addwebaccess__FirstTimeLogin = "0"
if("1" <> "") then SP_addwebaccess__FirstTimeLogin = "1"

Dim SP_addwebaccess__PermissionGroup
SP_addwebaccess__PermissionGroup = "0"
if("CMSClient" <> "") then SP_addwebaccess__PermissionGroup = "CMSClient"

Dim SP_addwebaccess__IsPswdEncrypted
SP_addwebaccess__IsPswdEncrypted = "0"
if("1" <> "") then SP_addwebaccess__IsPswdEncrypted = "1"

Dim SP_addwebaccess__IsLocked
SP_addwebaccess__IsLocked = "0"
if("0" <> "") then SP_addwebaccess__IsLocked = "0"

Dim SP_addwebaccess__IndvClientModule
SP_addwebaccess__IndvClientModule = "0"
if("1" <> "") then SP_addwebaccess__IndvClientModule = "1"

%>
<%

set SP_addwebaccess = Server.CreateObject("ADODB.Command")
SP_addwebaccess.ActiveConnection = MM_bluedot_STRING
SP_addwebaccess.CommandText = "dbo.Addclientwebaccess"
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@RETURN_VALUE", 3, 4)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@Loginid", 200, 1,100,SP_addwebaccess__Loginid)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@Password", 200, 1,255,SP_addwebaccess__Password)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@Userid", 3, 1,4,SP_addwebaccess__Userid)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@Expdate", 7, 1,10,SP_addwebaccess__Expdate)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@Uploadocs", 901, 1,4,SP_addwebaccess__Uploadocs)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@Usefulinks", 901, 1,4,SP_addwebaccess__Usefulinks)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@client_personalprofile", 901, 1,4,SP_addwebaccess__client_personalprofile)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@client_maincase", 901, 1,4,SP_addwebaccess__client_maincase)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@client_relcases", 901, 1,4,SP_addwebaccess__client_relcases)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@client_case_geninfo", 901, 1,4,SP_addwebaccess__client_case_geninfo)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@client_case_atty", 901, 1,4,SP_addwebaccess__client_case_atty)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@client_case_comments", 901, 1,4,SP_addwebaccess__client_case_comments)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@client_case_docs", 901, 1,4,SP_addwebaccess__client_case_docs)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@client_case_forms", 901, 1,4,SP_addwebaccess__client_case_forms)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@client_case_billing", 901, 1,4,SP_addwebaccess__client_case_billing)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@client_case_steps", 901, 1,4,SP_addwebaccess__client_case_steps)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@firmid", 3, 1,4,SP_addwebaccess__firmid)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@Enable", 901, 1,4,SP_addwebaccess__Enable)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@FirstTimeLogin", 901, 1,4,SP_addwebaccess__FirstTimeLogin)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@PermissionGroup", 200, 1,50,SP_addwebaccess__PermissionGroup)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@IsPswdEncrypted", 901, 1,4,SP_addwebaccess__IsPswdEncrypted)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@IsLocked", 901, 1,4,SP_addwebaccess__IsLocked)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@IndvClientModule", 901, 1,4,SP_addwebaccess__IndvClientModule)
SP_addwebaccess.CommandType = 4
SP_addwebaccess.CommandTimeout = 0
SP_addwebaccess.Prepared = true
SP_addwebaccess.Execute()

Open in new window



This is the error:

ADODB.Command error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/bluedot/Intranet/Contacts/webaccess_SPadd.asp, line 207


Line 207 is:  SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@Usefulinks", 901, 1,4,SP_addwebaccess__Usefulinks)
LVL 1
AleksAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

chaauCommented:
Where did you get the DataTypeEnum with value of 901? According to MSDN there is no such type. The closest one for the BIT datatype in my opinion is adBoolean (value 11). Try replacing all 901 values to 11. Also, the size for the BIT must be 1:
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@Uploadocs", 11, 1,1,SP_addwebaccess__Uploadocs)
SP_addwebaccess.Parameters.Append SP_addwebaccess.CreateParameter("@Usefulinks", 11, 1,1,SP_addwebaccess__Usefulinks)
' etc - replace all "901, 1, 4" to "11, 1, 1" and see how it goes

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AleksAuthor Commented:
I did, this is now what I get:

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

[Microsoft][ODBC SQL Server Driver]Optional feature not implemented

/bluedot/Intranet/Contacts/webaccess_SPadd.asp, line 229
0
chaauCommented:
And what is at line 229?
0
AleksAuthor Commented:
I changed to datetime and that got it to work. thanks !
0
AleksAuthor Commented:
Thx.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

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.