Trying to use a stored procedure

Discussion in 'ASP General' started by bobby_b_, Feb 1, 2007.

  1. bobby_b_

    bobby_b_ Guest

    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")
    bobby_b_, Feb 1, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brenda Pasquarello

    MS Access Query - use like stored procedure?

    Brenda Pasquarello, Mar 7, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    3,699
    Michael Bohman
    Mar 8, 2006
  2. TaeHo Yoo
    Replies:
    0
    Views:
    394
    TaeHo Yoo
    Aug 14, 2003
  3. news.sbcglobal.net
    Replies:
    2
    Views:
    635
    Erland Sommarskog
    Jun 11, 2006
  4. Mike P
    Replies:
    0
    Views:
    3,280
    Mike P
    Jun 19, 2006
  5. bobby_b_

    Trying to use a stored procedure

    bobby_b_, Feb 1, 2007, in forum: ASP General
    Replies:
    0
    Views:
    130
    bobby_b_
    Feb 1, 2007
Loading...

Share This Page