Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 convert array to database, wont work. help please!

Author  Topic 

Ayeidea
Starting Member

17 Posts

Posted - 2001-10-26 : 15:17:39
Hi, in my admin of the site im working on, the owner can add products to the site by filling out forms on the add products page. everything gets inserted into the database fine except the sizes. i would like to give him the abiltity to select multiple sizes to add to the database. but when you do any of that it returns this error.

quote:
ADODB.Command error '800a0d5d'

Application uses a value of the wrong type for the current operation.

/admin/edit/main/product.color.asp, line 192


and here is the code for that action:
quote:

sizeArray = upl.form("sizef")
'response.write sizeArray
MySArray = split(sizeArray,",")

For I=0 to Ubound(MySArray)
hereyougo = MySArray
set insertSize_SP = Server.CreateObject("ADODB.Command")
insertSize_SP.ActiveConnection = MM_onlineSQL_STRING
insertSize_SP.CommandText = "akolade.sp_insert_size"
insertSize_SP.CommandType = 4
insertSize_SP.CommandTimeout = 0
insertSize_SP.Prepared = true
insertSize_SP.Parameters.Append insertSize_SP.CreateParameter("RETURN_VALUE", 3, 4)
insertSize_SP.Parameters.Append insertSize_SP.CreateParameter("@ProdID", adInteger, adParamInput,4,newid)
insertSize_SP.Parameters.Append insertSize_SP.CreateParameter("@Size", adVarChar, adParamInput,30,hereyougo)
insertSize_SP.Execute()
insertSize_SP.close()
Next




the createParameter("@size,adVarChar,adParamInput,30,hereyougo) is line line 192


and this is the stord.proc. :
quote:
CREATE PROCEDURE [sp_insert_size]
(@ProdID [int],
@Size [varchar](30))

AS
SET NOCOUNT ON

INSERT INTO [akolade].[akolade].[size]
( [ProdID],
[Size])

VALUES
( @ProdID,
@Size)

SET NOCOUNT OFF




im so lost here. anyone know what im doing wrong?
john

   

- Advertisement -