Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old September 25th, 2008, 03:23 AM
Member
 
Join Date: Sep 2006
Posts: 70
Default input parameter error

Microsoft OLE DB Provider for SQL Server error '80040e10'

Procedure or Function 'get_user' expects parameter '@user_id', which was not supplied.

/Intranet/MainVal2.asp, line 18
-------------------------------------------------------------------------------------------------------------------
Expand|Select|Wrap|Line Numbers
  1. dim val
  2. set rm = Server.CreateObject ("ADODB.Command")
  3. rm.ActiveConnection=OBJdbConnection
  4. rm.CommandText="get_user"
  5.  
  6. rm.Parameters.Append rm.CreateParameter("RETURN",adInteger,adParamReturnValue,4)
  7.  
  8. rm.Parameters.Append rm.CreateParameter("@user_id",adVarChar,adParamInput,8,request("NoStaf"))
  9.  
  10. rm.Parameters.Append rm.CreateParameter("@pwd",adVarChar,adParamInput,12,request("Pwd"))
  11. rm.Execute 
  12. val=rm.Parameters("RETURN").Value
Expand|Select|Wrap|Line Numbers
  1. set ANSI_NULLS ON
  2. set QUOTED_IDENTIFIER ON
  3. go
  4.  
  5.  
  6. ALTER PROCEDURE [dbo].[get_user]
  7. (    
  8.     @user_id varchar(8),
  9.     @pwd varchar(12)
  10.     )
  11. AS
  12.  
  13. IF EXISTS(SELECT Personel_No From TblUser_ID where Personel_No = @user_id)
  14.     BEGIN
  15.     IF EXISTS(SELECT Password From TblUser_ID where Personel_No = @user_id AND Password = @pwd)
  16.         BEGIN
  17.             INSERT INTO TblAudit_Trails(Personel_No,IC_Baru,Business_Area) 
  18.                 SELECT Personel_No,IC_Baru,Business_Area 
  19.                 From TblPeribadi 
  20.                 where Personel_No = @user_id AND IC_Baru = @pwd
  21.             RETURN(3)
  22.         END
  23.     ELSE
  24.         RETURN(1)
  25.     END
  26. ELSE
  27.     BEGIN
  28.     IF EXISTS(SELECT Personel_No From TblPeribadi where Personel_No = @user_id)
  29.         BEGIN
  30.         IF EXISTS(SELECT IC_Baru From TblPeribadi where Personel_No = @user_id AND IC_Baru = @pwd)
  31.             BEGIN
  32.                 INSERT INTO TblUser_ID(Personel_No,Password,Update_By) 
  33.                     VALUES(@user_id,@pwd,@user_id)
  34.                 INSERT INTO TblAudit_Trails(Personel_No,IC_Baru,Business_Area) 
  35.                     SELECT Personel_No,IC_Baru,Business_Area 
  36.                     From TblPeribadi 
  37.                     where Personel_No = @user_id AND IC_Baru = @pwd
  38.                 RETURN(4)
  39.             END
  40.         ELSE
  41.             RETURN(2)
  42.         END
  43.     ELSE
  44.         RETURN(0)
  45.     END
  46.  
Reply
  #2  
Old September 25th, 2008, 03:50 AM
Member
 
Join Date: Sep 2006
Posts: 70
Default

You know what... after surfing to this site:\
it works perfectly, so follow thisadovbs.inc solution for ADODB.Command error '800a0bb9'

and read whote faq I put this solution on my works:
Expand|Select|Wrap|Line Numbers
  1. <!-- #include virtual="/Intranet/includes/adovbs.inc" -->
  2. ...
  3. ...
  4. ...
  5. rm.CommandType=adCmdStoredProc
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles