Probs datatype both in ASP & SQLDB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MATTXtwo
    New Member
    • Sep 2006
    • 83

    Probs datatype both in ASP & SQLDB

    Microsoft OLE DB Provider for SQL Server error '80004005'

    The precision is invalid.

    /Intranet/hr/Change_Password _db.asp, line 16
    -------------------------------------------------------------------------------------------------------------------
    Code:
    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,D ate_Update=getd ate(),Update_By =@user_id WHERE Personel_No=@us er_id
    /CODE]
    The reason I change to numeric datatype:/
    Code:
    CREATE TABLE [dbo].[tblUser_ID](
    	[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????
  • MATTXtwo
    New Member
    • Sep 2006
    • 83

    #2
    Again I found some solution on this link
    Precission Invalid
    that uses this code
    Code:
    set param=rm.CreateParameter("@user_id",adNumeric,adParamInput,8,request("NoStaf"))
    param.precision=18			'Solution for 
    param.numericscale=0		'Microsoft OLE DB Provider for SQL Server error '80004005'
    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

    Comment

    Working...