473,473 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Trying to use a stored procedure

Hello,
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-
versa).

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")
cmd.Execute

sUser = cmd.Parameters("PLAINTEXT")

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

sPwd = cmd.Parameters("PLAINTEXT")

Feb 1 '07 #1
0 1418

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
1
by: Brad H McCollum | last post by:
I've looked through many suggestions and partial examples all over this newsgroup and still am not coming up with anything that does specifically what I'm wanting to accomplish. I'm writing a VB...
8
by: Thomasb | last post by:
With a background in MS SQL Server programming I'm used to temporary tables. Have just started to work with DB2 ver 7 on z/OS and stumbled into the concept of GLOBAL TEMPORARY TABLE. I have...
0
by: pareh | last post by:
Hi I get a very strange message when I'm trying to compile a stored procedure. "Error: Input string was not in a correct format." What more that is interesting is that I have compile my...
2
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
0
by: bobby_b_ | last post by:
Hello, 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...
1
by: sshankar | last post by:
Hi, New to Stored procedure. Basically just installed DB2 v8.1.0.36 Was trying to build a stored procedure.. It is giving following error.. Looks like some error related to configuration...
2
by: jed | last post by:
I have created this example in sqlexpress ALTER PROCEDURE . @annualtax FLOAT AS BEGIN SELECT begin1,end1,deductedamount,pecentageextra FROM tax
2
by: E11esar | last post by:
Hello there. I am going in bit of a circle with this matter; First some background: I am trying to upload the details of a CSV file into an Oracle table. I am using a StreamReader to copy a line...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.