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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to display stored procedure output in ASP ?

Status
Not open for further replies.

volk125

Technical User
Jul 10, 2003
76
CA
I have stored procedure that I have to run in an ASP page that once get it's 2 input parameters then outputs a table (the result). How do I specify the output parameters of the stored procedure to display the result in an HTML table format ?

method I am using to connect is and run the procedure is this:

dim connstring, conn, cmdDetails, itemVar, descriptionVar
ConnString = "Provider=sqloledb;Data Source=*********;Initial Catalog=*********;User Id=*******;Password=*********;"
Set conn = Server.CreateObject("ADODB.Connection")
Set cmdDetails = Server.CreateObject("ADODB.Command")
conn.Open ConnString

cmdDetails.CommandText = "sp_WebItemLookup"
cmdDetails.ActiveConnection = Conn
cmdDetails.CommandType = adCmdStoredProc

cmdDetails.Parameters.Append cmdDetails.CreateParameter("@item",adVarChar,adParamInput,128,item)
cmdDetails.Parameters.Append cmdDetails.CreateParameter("@description",adVarChar, adParamInput,128,plist)

cmdDetails.execute

conn.close
set conn = nothing
set cmdDetails = nothing


the procedure accepts 2 parameters Item and Description and then outputs a result table with column names: Item, Description,SerialNumber,Quantity,cost,Warehouse,Bin,
stocktype,WarehouseType,InventoryContact,City.

I did it before without using stored procedures just by creating a recordset and looping through it but with this stored procedure stuff I got confused about the output.

Experts please help me out.
 
The data from the stored procedure will be returned as a record set. Check with the folks in the .NET forums about the .NET code to use to grap the recordset and process it.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top