<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: ASP: A template that will show all data from a table (including header rows)</title>
	<atom:link href="http://www.scriptygoddess.com/archives/2003/06/02/asp-a-template-that-will-show-all-data-from-a-table-including-header-rows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scriptygoddess.com/archives/2003/06/02/asp-a-template-that-will-show-all-data-from-a-table-including-header-rows/</link>
	<description></description>
	<pubDate>Fri, 21 Nov 2008 06:29:46 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Jennifer</title>
		<link>http://www.scriptygoddess.com/archives/2003/06/02/asp-a-template-that-will-show-all-data-from-a-table-including-header-rows/#comment-9932</link>
		<dc:creator>Jennifer</dc:creator>
		<pubDate>Tue, 30 Nov 1999 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/06/02/asp-a-template-that-will-show-all-data-from-a-table-including-header-rows/#comment-9932</guid>
		<description>dvg - You wouldn't happen to know how to make that SQL statement so that it's called as a stored procedure? (I'm required to make all database calls from stored procedures)</description>
		<content:encoded><![CDATA[<p>dvg - You wouldn&#039;t happen to know how to make that SQL statement so that it&#039;s called as a stored procedure? (I&#039;m required to make all database calls from stored procedures)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dvg</title>
		<link>http://www.scriptygoddess.com/archives/2003/06/02/asp-a-template-that-will-show-all-data-from-a-table-including-header-rows/#comment-9933</link>
		<dc:creator>dvg</dc:creator>
		<pubDate>Tue, 30 Nov 1999 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/06/02/asp-a-template-that-will-show-all-data-from-a-table-including-header-rows/#comment-9933</guid>
		<description>Yes, I do.  I know everything.  It's quite amazing, actually.

Sorry ... I would have replied sooner, but I work all day.  heh.

Do you have access to SQL Server's Enterprise Mangler?  What platform are you using?

Send me an email.
</description>
		<content:encoded><![CDATA[<p>Yes, I do.  I know everything.  It&#039;s quite amazing, actually.</p>
<p>Sorry &#8230; I would have replied sooner, but I work all day.  heh.</p>
<p>Do you have access to SQL Server&#039;s Enterprise Mangler?  What platform are you using?</p>
<p>Send me an email.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan</title>
		<link>http://www.scriptygoddess.com/archives/2003/06/02/asp-a-template-that-will-show-all-data-from-a-table-including-header-rows/#comment-9931</link>
		<dc:creator>Bryan</dc:creator>
		<pubDate>Tue, 30 Nov 1999 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/06/02/asp-a-template-that-will-show-all-data-from-a-table-including-header-rows/#comment-9931</guid>
		<description>If you have access to your global.asa you should use Type Libraries instead of ADOVBS.inc

See http://www.asp101.com/articles/john/typelibs/default.asp for details.</description>
		<content:encoded><![CDATA[<p>If you have access to your global.asa you should use Type Libraries instead of ADOVBS.inc</p>
<p>See <a href="http://www.asp101.com/articles/john/typelibs/default.asp" rel="nofollow">http://www.asp101.com/articles/john/typelibs/default.asp</a> for details.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dvg</title>
		<link>http://www.scriptygoddess.com/archives/2003/06/02/asp-a-template-that-will-show-all-data-from-a-table-including-header-rows/#comment-9930</link>
		<dc:creator>dvg</dc:creator>
		<pubDate>Tue, 30 Nov 1999 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/06/02/asp-a-template-that-will-show-all-data-from-a-table-including-header-rows/#comment-9930</guid>
		<description>To be on the safe side, it's best to wrap your call to rs(y) with a Trim() like so:  Trim(rs(y)).

I also recommend being explicit when you can ...
Trim(rs.Fields(y).Value) is even better (for readability's sake at least).

You can make your rows sortable, too!  A quick change is all you need to your recordset object:

Dim rs, obj, strSQL, strASCDESC, db_cnx, i

db_cnx = "Provider=SQLOLEDB.1;Password=EnterPasswordHere;User ID=enterDBUserNameHere; initial Catalog=EnterDatabaseNameHere;Data Source=EnterSQLServerBoxName"

Set obj = Server.CreateObject("adodb.connection")
Set rs = Server.CreateObject("adodb.recordset")
obj.Open db_cnx
strSQL = "SELECT state_id, state, state_abbr AS abbreviation FROM Coastal.dbo.State ORDER BY state"
rs.CursorLocation = 3
rs.Open strSQL, obj
If Trim(Request.QueryString("ascdesc")) = "ASC" Then
     strASCDESC = "DESC"
Else
     strASCDESC = "ASC"
End If
If Trim(Request.QueryString("sort")) &gt; "" Then
     rs.Sort = Trim(Request.QueryString("sort")) &#038; " " &#038; strASCDESC
End If
If Not rs.EOF Then
Response.Write "&#60;tr&#62;"
For i = 0 to rs.Fields.Count - 1
     Response.Write "&#60;a href=""?ascdesc=" &#038; strASCDESC &#038; "&#38;sort=" &#038; rs.Fields(i).Name &#038; """&#62;"
     Response.Write rs.Fields(i).Name
     Response.Write "&#60;/a&#62;&#60;/td&#62;"
Next
Response.Write "&#60;/tr&#62;"
End If

Then continue with the rest of the code as it is in the example Jennifer gives.</description>
		<content:encoded><![CDATA[<p>To be on the safe side, it&#039;s best to wrap your call to rs(y) with a Trim() like so:  Trim(rs(y)).</p>
<p>I also recommend being explicit when you can &#8230;<br />
Trim(rs.Fields(y).Value) is even better (for readability&#039;s sake at least).</p>
<p>You can make your rows sortable, too!  A quick change is all you need to your recordset object:</p>
<p>Dim rs, obj, strSQL, strASCDESC, db_cnx, i</p>
<p>db_cnx = &#034;Provider=SQLOLEDB.1;Password=EnterPasswordHere;User ID=enterDBUserNameHere; initial Catalog=EnterDatabaseNameHere;Data Source=EnterSQLServerBoxName&#034;</p>
<p>Set obj = Server.CreateObject(&#034;adodb.connection&#034;)<br />
Set rs = Server.CreateObject(&#034;adodb.recordset&#034;)<br />
obj.Open db_cnx<br />
strSQL = &#034;SELECT state_id, state, state_abbr AS abbreviation FROM Coastal.dbo.State ORDER BY state&#034;<br />
rs.CursorLocation = 3<br />
rs.Open strSQL, obj<br />
If Trim(Request.QueryString(&#034;ascdesc&#034;)) = &#034;ASC&#034; Then<br />
     strASCDESC = &#034;DESC&#034;<br />
Else<br />
     strASCDESC = &#034;ASC&#034;<br />
End If<br />
If Trim(Request.QueryString(&#034;sort&#034;)) > &#034;&#034; Then<br />
     rs.Sort = Trim(Request.QueryString(&#034;sort&#034;)) &#038; &#034; &#034; &#038; strASCDESC<br />
End If<br />
If Not rs.EOF Then<br />
Response.Write &#034;&lt;tr&gt;&#034;<br />
For i = 0 to rs.Fields.Count - 1<br />
     Response.Write &#034;&lt;a href=&#034;"?ascdesc=&#034; &#038; strASCDESC &#038; &#034;&amp;sort=&#034; &#038; rs.Fields(i).Name &#038; &#034;&#034;"&gt;&#034;<br />
     Response.Write rs.Fields(i).Name<br />
     Response.Write &#034;&lt;/a&gt;&lt;/td&gt;&#034;<br />
Next<br />
Response.Write &#034;&lt;/tr&gt;&#034;<br />
End If</p>
<p>Then continue with the rest of the code as it is in the example Jennifer gives.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ingrid</title>
		<link>http://www.scriptygoddess.com/archives/2003/06/02/asp-a-template-that-will-show-all-data-from-a-table-including-header-rows/#comment-9929</link>
		<dc:creator>Ingrid</dc:creator>
		<pubDate>Tue, 30 Nov 1999 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/06/02/asp-a-template-that-will-show-all-data-from-a-table-including-header-rows/#comment-9929</guid>
		<description>The best ASP db editor around is here:
http://www.romankoch.ch/capslock/editor.htm

This is a universal table editor that, and has proven to be so usefull (at least to me). It's an excellent program (in asp) and totally free.</description>
		<content:encoded><![CDATA[<p>The best ASP db editor around is here:<br />
<a href="http://www.romankoch.ch/capslock/editor.htm" rel="nofollow">http://www.romankoch.ch/capslock/editor.htm</a></p>
<p>This is a universal table editor that, and has proven to be so usefull (at least to me). It&#039;s an excellent program (in asp) and totally free.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.293 seconds -->
