Search Search

#1 worldwide
FREE Coding Lessons

since 1996
   THE BEST WAY to learn ASP & Asp.net!
Advertise Here!
click for details
Credits Host:
DiscountASP.net
Server Admin:
The "Team"
Contact Info.
Charles M. Carroll

my Blog

ASP Commandment #4: Named Constants

Command #4: use named constants from adovbs.inc instead of numeric constants. (granted, adovbs.inc isn't complete and requires some add'l tweaking from time-to-time)

This is good:
<!--#INCLUDE VIRTUAL="/ADOVBS.INC" -->
<%
connectme="DSN=Student;uid=student;pwd=magic"
sqltemp="select * from publishers where state='NY'"
set rstemp=Server.CreateObject("adodb.Recordset")
rstemp.open sqltemp, connectme, adopenstatic
response.write rstemp.recordcount & " records in<br>" & sqltemp
rstemp.close
set rstemp=nothing

%>

This is bad:
<%
connectme="DSN=Student;uid=student;pwd=magic"
sqltemp="select * from publishers where state='NY'"
set rstemp=Server.CreateObject("adodb.Recordset")
rstemp.open sqltemp, connectme, 3
response.write rstemp.recordcount & " records in<br>" & sqltemp
rstemp.close
set rstemp=nothing

%>

There are many worthy charities!!. But perhaps help starving children in Africa or South America AND help Charles too. a $5 tip buys him lunch at McDonalds, a $20 tip buys his kid Hitoshi a new computer game, a $39 tip buys his daughter Michiko a few nice outfits. See our donor list.