Data type error from stored procedure

Results 1 to 2 of 2

Thread: Data type error from stored procedure

  1. #1
    Join Date
    Dec 1969

    Default Data type error from stored procedure

    &nbsp;<BR>Hello,<BR><BR>I&#039;m having trouble getting the stored procedure to work when I declare a parameter as decimal,any ideas on how to fix this problem?<BR><BR>Thanks,<BR><BR><BR><BR><BR>STORED PROCEDURE<BR>****************<BR><BR>CREATE PROCEDURE TestInsert<BR> @RecordID int, <BR> @Price decimal<BR>AS<BR>BEGIN<BR>UPDATE GBOrderEntry<BR>SET price =@Price <BR>WHERE RecordId=@RecordID <BR>END<BR><BR>ASP<BR>***<BR>Dim objCommand, strConnection<BR> Dim objConnection, objRS<BR> Dim strConn, objParam<BR> Dim lngRecs<BR> Dim lngAdded<BR> <BR> &#039; Open Connection<BR> Set objConnection = Server.CreateObject("ADODB.Connection")<BR> strConnection = "DSN=GlobeshareDS;UID=sa;Password=XXX"<BR> objConnection.Open strConnection<BR> <BR> &#039;Open Command Object<BR> Set objCommand = server.CreateObject("ADODB.Command")<BR> With objCommand<BR> .CommandText = "TestInsert"<BR> .CommandType = adCmdStoredproc<BR> .ActiveConnection = objConnection<BR> End With<BR><BR>Set objParam = objCommand.CreateParameter("@RecordID", adInteger, adParamInput, 4)<BR>objCommand.Parameters.Append objParam<BR>Set objParam = objCommand.CreateParameter("@Price ", adDecimal, adParamInput, 6 , Request.form("nprice"))<BR>objCommand.Parameters.A ppend objParam<BR>Set objRS = objCommand.Execute &#039;***line 85****&#039;<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Data type error from stored procedure

    You forgot to give this param a value:<BR><BR>&#062; Set objParam = objCommand.CreateParameter("@RecordID", adInteger, adParamInput, 4)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts