Link to home
Start Free TrialLog in
Avatar of millerfw
millerfwFlag for United States of America

asked on

Display value of query result in ASP

Hi Experts,

This seems simple enough but I can't figure it out or find a solution,  all I want to do is execute a sql query
sqlNewClients = "SELECT COUNT(AdvisorID) AS NewAdvisorID FROM TFN_Advisors"
And write the result in my ASP page

I need to replace There Are sqlNewClients  with the correct syntax.  Thanks

Dim objCmd
Set objCmd = Server.Createobject("ADODB.Connection")
strConnectionString = "Driver={SQL SERVER};Server=XXX.XX.XXX.XXX;Database=NAME;Uid=user;Pwd=password"
objCmd.Open strConnectionString
objCmd.Execute sqlNewClients
Set objCmd = Nothing
Response.Write("NewAdvisorID")
%>
<BR>
<font color ="navy" size=5><b><%="There Are sqlNewClients %>
<BR>

Open in new window

Avatar of millerfw
millerfw
Flag of United States of America image

ASKER

I forgot to add that if the values is zero I want to return the the home site if the values is >0 i want to return to the previous page.  I am assuming I can just right a function to do this just like in HTML.
ASKER CERTIFIED SOLUTION
Avatar of _Stilgar_
_Stilgar_
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial