This should be easy but i am having problems! My main problem is when I try to pass parameters to my SQL stored procedure. SQL code:
Code:
CREATE PROCEDURE [dbo].[sp_dropconst]
(@title as varchar)
AS
ALTER TABLE [usermeta]
DROP CONSTRAINT DF_usermeta_@title
ALTER TABLE [usermeta]
DROP COLUMN [@title]
GO
ASP code fragment:
Code:
Set objConn1 = Server.CreateObject("ADODB.Command")
objConn1.ActiveConnection = strDBConnect
objConn1.CommandText = "sp_dropconst"
objConn1.CommandType = adCmdStoredProc
Set objParam = _
objConn1.CreateParameter("@title", adVarChar, adParamInput, 8)
objConn1.Parameters.Append objParam
objConn1.Parameters("@title")= strTitle
objConn1.Execute
set objParam = NOTHING
set objConn1 = NOTHING
Main errors are:
"Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another."
I've re-read pages 564-594 of Beginners ASP but can't work out why my CommandType seems to error. Once this is ok then full steam ahead. Thanks to anyone in advance.