Avatar of michaeldean99
michaeldean99
Flag for United Kingdom of Great Britain and Northern Ireland asked on

stored procedure with classic asp

hi
this is an annoying problem!!! Would appreciate some help please.
I am missing something obvious but it is holding me up!

Michael

Classic asp code

invoked by
<%=readSetup("message")%>


Function ReadSetup(SetupKey)
DIM cmdSetupProc
DIM rstSetupProc
DIM ParamSetup

Set cmdSetupProc = Server.CreateObject("ADODB.Command")
cmdSetupProc.ActiveConnection = conn
cmdSetupProc.CommandType = adCmdStoredProc      
cmdSetupProc.CommandText = "GetSetupData"
cmdStoredProc.Parameters.Append .createParameter("@KEY", adVarchar(200), adParamInput,,SetUpKey)
SET rstSetupProc = cmdSetupProc.Execute
ReadSetup=rstSetupProc.Fields("TEXT")
End Function

The stored procedure  is:
USE [xxxxxx]
GO

/****** Object:  StoredProcedure [xxxxx].[GetSetupData]    Script Date: 05/04/2013 16:53:49 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER Procedure [xxxxx].[GetSetupData]
(
      @Key varchar(200)
)
AS
SELECT * FROM [Setup]  WHERE [key] = @Key
ASPProgrammingMicrosoft SQL Server

Avatar of undefined
Last Comment
Robert Schutt

8/22/2022 - Mon
Robert Schutt

Try this line instead of what you have there:
cmdSetupProc.Parameters.Append cmdSetupProc.createParameter("@KEY", adVarchar, adParamInput, 200, SetUpKey)

Open in new window

Note that the constants need to be defined otherwise it still won't work.
ASKER CERTIFIED SOLUTION
Robert Schutt

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.
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
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23