Getting Records from a Stored Procedure

Results 1 to 2 of 2

Thread: Getting Records from a Stored Procedure

  1. #1
    Join Date
    Dec 1969

    Default Getting Records from a Stored Procedure

    I&#039;m new to stored procedures and I&#039;m having trouble displaying the records produced by this one. I&#039;m using @Ticker as an input parameter and @DistDirs and @DistComps as output parameters which are displaying fine but how do I display the records themselves? Thanks.<BR><BR>&#060;!--#Include File=""--&#062;<BR>&#060;%<BR><BR>&#039;Create our connection (SQL Server OLEDB Connection)<BR> Set con=Server.Createobject("ADODB.Connection")<BR> con.ConnectionString = "Provider=SQLOLEDB; Data Source=; Initial Catalog=; User ID=; Password=" <BR> con.Open<BR><BR> strTicker = "IBM"<BR> <BR> Set rs = Server.CreateObject("ADODB.Recordset")<BR> Set cmd = Server.CreateObject("ADODB.Command")<BR> <BR> &#039;Set properties of the command<BR> With cmd<BR> Set .ActiveConnection = con<BR> .CommandText = "sp_co_interlinks_test"<BR> .CommandType = adCmdStoredProc<BR> <BR> &#039;Add the parameters<BR> .Parameters.Append .CreateParameter("@DistDirs", adInteger, adParamOutput) <BR> .Parameters.Append .CreateParameter("@DistComps", adInteger, adParamOutput)<BR> .Parameters.Append .CreateParameter("@Ticker", adVarChar, adParamInput, 255, strTicker) <BR> <BR> rs.Open cmd, ,adOpenForwardOnly, adCmdStoredProc <BR> <BR> DirectorsTotal = .Parameters("@DistDirs")<BR> CompanysTotal = .Parameters("@DistComps")<BR> End With<BR> <BR> Response.Write DirectorsTotal<BR> Response.Write CompanysTotal<BR> <BR> Set cmd = nothing<BR><BR>%&#062;<BR>

  2. #2
    Join Date
    Dec 1969

    Default What did you try?

    What didn&#039;t work?<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts