Avatar of probelaw
probelaw asked on

Multiple-step OLE DB operation generated errors.

I am trying to update database records using a stored procedure on SQL Server passing values from an ASP Script.  I keep getting errors, most of the time...

Multiple-step OLE DB operation generated errors.

I have a feeling it has something to do with my numeric fields, since I have not really worked with these much to date.

The sp and asp code are pasted below.  Any help would be appreciated.
ALTER PROCEDURE [dbo].[sp_CHEM_Containers_Update]
	-- Add the parameters for the stored procedure here
 
@ContainerID int,
@ChemicalName varchar(200),
@ChemicalFormula varchar(200),
@ContainerAmt numeric(18,2),
@ContainerAmtUnit varchar(50),
@ContainerType int,
@Amount numeric(18,2),
@AmountUnit varchar(10),
@EquivAmount numeric(18,2),
@EquivAmountUnit varchar(10),
@PurchaseDate datetime,
@Location int,
@StorageCode varchar(5),
@ModBy varchar(50),
@ModDate datetime,
@Verified bit,
@MSDSComplete bit,
@HSFSComplete bit,
@DeleteContainer bit
 
AS
 
Update CHEM_Containers
 
SET
 
ChemicalName=@ChemicalName,
ChemicalFormula=@ChemicalFormula,
ContainerAmt=@ContainerAmt,
ContainerAmtUnit=@ContainerAmtUnit,
ContainerType=@ContainerType,
Amount=@Amount,
AmountUnit=@AmountUnit,
EquivAmount=@EquivAmount,
EquivAmountUnit=@EquivAmountUnit,
PurchaseDate=@PurchaseDate,
Location=@Location,
StorageCode=@StorageCode,
ModBy=@ModBy,
ModDate=getdate(),
Verified=@Verified,
MSDSComplete=@MSDSComplete,
HSFSComplete=@HSFSComplete,
DeleteContainer=@DeleteContainer
 
WHERE
 
ContainerID = @ContainerID
 
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
END
 
 
-------------------------
 
set cmd_Update_Container = Server.CreateObject("ADODB.Command")
cmd_Update_Container.ActiveConnection = MM_sql_probelaw_com_jplace_STRING
cmd_Update_Container.CommandText = "dbo.sp_CHEM_Containers_Update"
cmd_Update_Container.CommandType = 4
cmd_Update_Container.CommandTimeout = 0
cmd_Update_Container.Prepared = true
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@RETURN_VALUE", 3, 4,8)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@ContainerID", 3, 1,8,cmd_Update_Container__ContainerID)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@ChemicalName", 200, 1,200,cmd_Update_Container__ChemicalName)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@ChemicalFormula", 200, 1,200,cmd_Update_Container__ChemicalFormula)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@ContainerAmt", 131, 1,18,cmd_Update_Container__ContainerAmt)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@ContainerAmtUnit", 200, 1,10,cmd_Update_Container__ContainerAmtUnit)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@ContainerType", 3, 1,8,cmd_Update_Container__ContainerType)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@Amount", 131, 1,18,cmd_Update_Container__Amount)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@AmountUnit", 200, 1,10,cmd_Update_Container__AmountUnit)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@EquivAmount", 131, 1,18,cmd_Update_Container__EquivAmount)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@EquivAmountUnit", 200, 1,10,cmd_Update_Container__EquivAmountUnit)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@PurchaseDate", 135, 1,50,cmd_Update_Container__PurchaseDate)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@Location", 3, 1,8,cmd_Update_Container__Location)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@StorageCode", 200, 1,5,cmd_Update_Container__StorageCode)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@ModBy", 200, 1,50,cmd_Update_Container__ModBy)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@ModDate", 135, 1,50,cmd_Update_Container__ModDate)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@Verified", 3, 1,1,cmd_Update_Container__Verified)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@MSDSComplete", 3, 1,1,cmd_Update_Container__MSDSComplete)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@HSFSComplete", 3, 1,1,cmd_Update_Container__HSFSComplete)
cmd_Update_Container.Parameters.Append cmd_Update_Container.CreateParameter("@DeleteContainer", 3, 1,1,cmd_Update_Container__DeleteContainer)
 
 
cmd_Update_Container.Execute()

Open in new window

ASPMicrosoft SQL ServerMicrosoft SQL Server 2005

Avatar of undefined
Last Comment
dosth

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
patrikt

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
dosth

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes