Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 Other Topics
 Retrieving calculations performed with SQL

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-11-30 : 16:02:40
Kiat writes "How do I reference the returned value from a sql statement which designates an alias for a returned a value, into an ASP page.
I get a "not the ADO collection error" when attempting to reference "Avg_Score" in the ASP page
What is the proper syntax to write this value in the ASP page?
I am using a SP which contains the select statement.
If I run the select statement in the SQL Query Analyzer I get back:

Avg_Score
----------
42

so I know I am getting a valued returned.

within the SP:
select avg(score) as Avg_Score from t_scores


within the page:
Dim szAvgScore

if isNull(oRS("Avg_Score") then
szAvgScore = 0
else
szAvgScore = oRS("Avg_Score")
end if

but it doesn't matter. It's saying the error is caused by the field not existing. How do I access this value as not a field but something else? GetInt, GetString?

as in oRS.GetString("Avg_Score")
or oRS.GetInt("Avg_Score")
"
   

- Advertisement -