Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 11th, 2004, 12:40 PM
Registered User
 
Join Date: Jul 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Vars passed to SQL Stored Procedures

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.
 
Old March 15th, 2004, 05:35 PM
Registered User
 
Join Date: Jul 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Its all OK now - i'll tell you all what what wrong at a later date, but for now suffice to say i was dealing with the wrong type od ADODB object collection.






Similar Threads
Thread Thread Starter Forum Replies Last Post
asp and ms sql stored procedures solomon_13000 Classic ASP Basics 1 July 11th, 2005 12:04 AM
the SQL stored procedures BenCh BOOK: ASP.NET Website Programming Problem-Design-Solution 0 March 11th, 2005 04:18 PM
Crystal 9 and stored procedures with dynamic sql Pravs VB How-To 0 December 9th, 2004 05:48 AM
SQL Pass though parameters to stored procedures blinton25 SQL Server 2000 3 March 29th, 2004 02:49 PM
Professional Sql Server 7 Stored Procedures Darrell Clary All Other Wrox Books 0 October 8th, 2003 09:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.