Classic ASP page to call a SQL2008 stored procedure that returns a recordset and populate an HTML table

IN PROGRESS
Bids
4
Avg Bid (USD)
$55
Project Budget (USD)
$30 - $250

Project Description:
For years we have used a block of code to store the results of a SQL select statement in a recordset in Classic ASP, then move through the recordset and built an HTML table with the data.

Now we'd like to do the same with a stored procedure using 1 integer input parameter which was originally used to augment the where clause of the select statement. The page needs to call the stored procedure with the appropriate parameter, and store the resulting recordset in the rst variable so that we can use the existing code to output the field names as headers and cycle through all records building table rows for each.

The stored procedure we're calling is below:

/****** Object: StoredProcedure [dbo].[temp2] Script Date: 02/14/2013 13:27:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[temp2]
@dr int = 33

AS
BEGIN
SET NOCOUNT ON;
select * from dept where DBCOL = @dr
SET NOCOUNT OFF;

END

Our Classic ASP code is along these lines:

'-- Create object and open database
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConn
Set objCmd = Server.CreateObject("ADODB.Command")
objCmd.ActiveConnection = objConn
dr = 1
strSQL = "select * from dept where DBCOL =" & dr
objCmd.CommandText = strSQL
set rst = Server.CreateObject("ADODB.Recordset")
rst.Open objCmd, , 1, 1

Response.Write "" & vbcrlf
if not [url removed, login to view] and not [url removed, login to view] then
rst.MoveLast
rst.MoveFirst
if rst.RecordCount 0 then
for each X in rst.Fields
select case X.name
case "fieldswedontwant"
case else
Response.Write "" & X.name & "" & vbcrlf
end select
next
Response.Write "" & vbcrlf
while not [url removed, login to view]
for each X in rst.Fields
select case X.name
case "fieldswedontwant"
case else
response.write "" & rst.fields(X.name).value & " " & vbcrlf
end select
next
Response.Write "" & vbcrlf
rst.MoveNext
wend
ELSE
Response.Write "No Records Found."
end if

end if
Response.Write ""
rst.Close
set rst = nothing

Skills required:
ASP, SQL
About the employer:
Verified
Public Clarification Board
Bids are hidden by the project creator. Log in as the employer to view bids or to bid on this project.
You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.


Hire wontonesaju
$ 50
in 1 days
Hire expertcoder1vw
$ 70
in 3 days
$ 60
in 2 days
$ 40
in 2 days