VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



How to call a stored procedure from active server pages

by Muhammad Atif Tahir (1 Submission)
Category: Active Server Pages
Compatability: ASP (Active Server Pages)
Difficulty: Unknown Difficulty
Originally Published: Thu 20th May 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)

How to call a stored procedure from active server pages

Rate How to call a stored procedure from active server pages



<% option explicit%>
<!-- #include virtual="adovbs.inc"-->
'Open the Connection
set conn = Server.CreateObject("ADODB.Connection")
conn.open "dsn=dsn;uid=username;pwd=password"
'Now call the stored Procedure
Set cmd=Server.CreateObject("ADODB.Command")
set cmd.activeconnection=conn
cmd.commandtext="Procedure_name"
   cmd.commandtype=adcmdStoredProc
   cmd.parameters.refresh
   cmd.parameters(1).value = Value1
   cmd.parameters(2).value = Value2
   .
   .
   cmd.parameters(n).value = Valuen
'for the ouput from stored procdure
  cmd.execute
  returnvalue = cmd.parameters(0).value      
' and for resultset
  set rs = cmd.execute.
  conn.close

    




Download this snippet    Add to My Saved Code

How to call a stored procedure from active server pages Comments

No comments have been posted about How to call a stored procedure from active server pages. Why not be the first to post a comment about How to call a stored procedure from active server pages.

Post your comment

Subject:
Message:
0/1000 characters