troubleshooting Question

Multiple-step OLE DB operation generated errors.

Avatar of probelaw
probelaw asked on
Microsoft SQL ServerASPMicrosoft SQL Server 2005
2 Comments1 Solution407 ViewsLast Modified:
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()
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros