Suppose you are creating a dynamic page in ASP. Most of the page elements are dynamic and you need a few of the headers to have the first letter of each work to be capitalized. With a very small amount of CSS, you can avoid using VBScript for string manipulation. Using
text-transform:capitalize you can apply a quick style to any database driven data.
<%
'Create the variables
Dim Conn, RS, SQL
'Set your connection and recordset
Set Conn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.Recordset")
'Set the DSN of the connection
Conn.Open "DSN=myODBC"
'create the SQL string
SQL = "Select TopicTitle From Topics Where ID > 0"
'Open the recordset and make it read-only
RS.Open (SQL), Conn,1,1
'loop through recordset
if not RS.EOF then %>
<!-- The "style" attribute of the DIV tag holds the CSS that will transform the text. -->
<div style="text-transform:capitalize"><%=TopicTitle%></div><br>
<%
'end IF statement and cleanup database info
RS.Close
end if
Set RS = Nothing
Conn.Close
Set Conn = Nothing
%>