harleychick
Programmer
Background info:
I have a main SQL stored procedure that calls the crosstab stored procedure found on the website below:
I return the SQL statement (@sql) from the crosstab stored procedure into the main stored procedure and then run an [blue]EXEC (@sql)[/blue] command.
SQL Query Analyzer runs the stored proc without any errors and returns a recordset with 5 columns. The first two column names are static and the last three column names are dynamically built by the crosstab.
Problem:
When I access the recordset from an ASP page, the ASP page only thinks there are 2 columns (the columns with static names). I returned a field count and field names to the webpage using code below:
[red]Why won't ASP recognize the other columns????[/red] I've been searching for a solution online for two days and haven't found anything.
I have a main SQL stored procedure that calls the crosstab stored procedure found on the website below:
I return the SQL statement (@sql) from the crosstab stored procedure into the main stored procedure and then run an [blue]EXEC (@sql)[/blue] command.
SQL Query Analyzer runs the stored proc without any errors and returns a recordset with 5 columns. The first two column names are static and the last three column names are dynamically built by the crosstab.
Problem:
When I access the recordset from an ASP page, the ASP page only thinks there are 2 columns (the columns with static names). I returned a field count and field names to the webpage using code below:
Code:
Dim fld
Response.Write "Field Count:" & rs.Fields.Count For each fld in rs.Fields
Response.Write fld.Name & "<BR>"
Next