Connecting Tech Pros Worldwide Forums | Help | Site Map

Probs datatype both in ASP & SQLDB

Member
 
Join Date: Sep 2006
Posts: 73
#1: Sep 25 '08
Microsoft OLE DB Provider for SQL Server error '80004005'

The precision is invalid.

/Intranet/hr/Change_Password_db.asp, line 16
-------------------------------------------------------------------------------------------------------------------
Expand|Select|Wrap|Line Numbers
  1. rm.Parameters.Append rm.CreateParameter("@user_id",adNumeric,adParamInput,8,request("NoStaf"))
-----------------------------ON STORE PROCEDURE------------------------------------------------
[code]
[@user_id numeric(8),
..
UPDATE TblUser_ID SET Password=@pwd,Date_Update=getdate(),Update_By=@use r_id WHERE Personel_No=@user_id
/CODE]
The reason I change to numeric datatype:/
Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE [dbo].[tblUser_ID](
  2.     [Personel_No] [numeric](8, 0) NOT NULL,
Problems occur when I change from varchar datatype to numeric type....
For some reason INSERT statement on store procedure run smoothly without error, But not for UPDATE statement????

Member
 
Join Date: Sep 2006
Posts: 73
#2: Sep 25 '08

re: Probs datatype both in ASP & SQLDB


Again I found some solution on this link
Precission Invalid
that uses this code
Expand|Select|Wrap|Line Numbers
  1. set param=rm.CreateParameter("@user_id",adNumeric,adParamInput,8,request("NoStaf"))
  2. param.precision=18            'Solution for 
  3. param.numericscale=0        'Microsoft OLE DB Provider for SQL Server error '80004005'
  4. rm.Parameters.Append param    'The precision is invalid.
You know why???
Coz for datatype numeric and decimal it was a problem for old version asp
need to declare the precision and numericscale said by MSN.
That's OK, other thing make me mad is MSN link for this solution is broken
So if you're lucky you'ill find this article, if not you're on your own
Reply