Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling Stored Procedure

Status
Not open for further replies.

Elton1984

Programmer
Mar 8, 2004
16
Hi all,
i have a problem here.. I'm supposed to code a set of codes that would allow me to call a stored procedure from SQL.
The problem is tat i have to convert this whole chunk of ASP codes to JSP codes.. And i am not familiar wif ASP as well as a stored procedure that requires variables..

Anyone can help??

Thanx in advance
Elton


set cmdAddUser = Server.CreateObject("ADODB.Command")
cmdAddUser.ActiveConnection = MM_cnkiosklogin_STRING
cmdAddUser.CommandText = "dbo.ENCRYPTPWD"
cmdAddUser.CommandType = 4
cmdAddUser.CommandTimeout = 0
cmdAddUser.Prepared = true
cmdAddUser.Parameters.Append cmdAddUser.CreateParameter("@RETURN_VALUE", 3, 4)
cmdAddUser.Parameters.Append cmdAddUser.CreateParameter("@myuserid", 200, 1,20,cmdAddUser__myuserid)
cmdAddUser.Parameters.Append cmdAddUser.CreateParameter("@myuserpwd", 200, 1,30,cmdAddUser__myuserpwd)
cmdAddUser.Parameters.Append cmdAddUser.CreateParameter("@outparm", 3, 2)
cmdAddUser.Parameters.Append cmdAddUser.CreateParameter("@counter", 3, 2)
cmdAddUser.Parameters.Append cmdAddUser.CreateParameter("@length", 3, 2)
cmdAddUser.Parameters.Append cmdAddUser.CreateParameter("@encryptedpwd", 200, 2,200)
set rsAddUser = cmdAddUser.Execute
rsAddUser_numRows = 0

rsAddUser.close()
'RtnValue = cmdAddUser.Parameters.Item("@RETURN_VALUE").Value
MyDecryptedPwd = trim(cmdAddUser.Parameters.Item("@encryptedpwd").Value)
 
Hmmz it is quite helpful sedj thanx..
But i would like to noe if the stored procedure tat i haf copied out on top is it a stored procedure that is trying to retrieve data from DB or passing data into the DB..

Then hw can i use "registerOutParameter" in this case.. And "CreateParameter" from asp is it the same as "registerOutParameter" in the jsp format...

I hope u all can understand what i am saying here..

Thanx in advance,
Elton
 
I'm not really familiar with ASP - I would look at the stored proc you are trying to call, and work out which parameters are which from that ...

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top