Avatar of michaeldean99
michaeldean99Flag 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
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

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
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Microsoft SQL Server
Microsoft SQL Server

Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.

171K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo