Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Trying to use a stored procedure

Thread Tools

Trying to use a stored procedure

Posts: n/a
I'm trying to access a stored procedure on our AS400 that is written
in RPG. I know that the stored procedure works (I've called it from
an RPG program on the AS400), and I know that the connection to the
AS400 is good, because this same ASP page is reading data via SQL.
However, when I try to call the stored procedure, I can't tell if
anything is actually happening. All that I know is that the end
result is not being changed, so I suspect that the procedure isn't
being called correctly.
My stored procedure is used to encrypt/decrypt data. It has 3
parameters - a 1 character flag telling it whether to encrypt or
decrypt, a 25 character field for the plaintext data, and a 50
character field for the encrypted data. The last two parameters are
used for either input or output, depending on the value of the first
flag (if the flag is "E", then the plaintext is used as input and the
program fills the encrypted data field. If the flag is "D", then vice-

Here is the code where I call my stored procedure. I'm trying to
decrypt data from the queryString and place it in some program
variables. I'm new to ASP, and can't find any good examples for my
situation, so I pieced this together from what examples I found
online. Can anyone tell me what I'm missing? Thanks in advance!

dim cmd
Set cmd = Server.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = cn
cmd.CommandText = "ENCRYPTDECRYPT"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Append cmd.CreateParameter("FUNCTION", adChar, _
adParamInput, 1)
cmd.Parameters.Append cmd.CreateParameter("PLAINTEXT", adChar, _
adParamInputOutput, 25)
cmd.Parameters.Append cmd.CreateParameter("CYPHERTEXT", adChar,
adParamInputOutput, 50)
cmd.Parameters("FUNCTION") = "D"
cmd.Parameters("CYPHERTEXT") = Request.QueryString("user")

sUser = cmd.Parameters("PLAINTEXT")

cmd.Parameters("CYPHERTEXT") = Request.QueryString("pwd")

sPwd = cmd.Parameters("PLAINTEXT")

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to use a stored procedure bobby_b_ ASP General 0 02-01-2007 02:34 PM
'Procedure or function <stored procedure name> has too many arguments specified',,,ARGH! Mike P ASP .Net 0 06-19-2006 01:19 PM
Create XML in ASP.NET 2.0 then use for joined table in SQL Server 2005 Stored Procedure ASP .Net 2 06-11-2006 08:55 AM
MS Access Query - use like stored procedure? Brenda Pasquarello ASP .Net 1 03-08-2006 12:46 PM
How to use parameters(record selection) and stored procedure in CR.NET web-based application? TaeHo Yoo ASP .Net 0 08-13-2003 11:13 PM