| {\rtf1\ansi\ansicpg1252\deff0\deflang1044{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}} \viewkind4\uc1\pard\f0\fs20 This ASP function uses the GetString method of the Recordset object to quickly and easily render an HTML table from the recordset. See comments within the code for more detail about how it works and an example \par \fs17 \par <% \par Function RecordsetToTable(rs) \par \par ' open the table (You should change attributes such as \par 'Border, CellSpacing, etc. based on your own needs here \par Response.Write "
\par \par End Function \par \par \par %> \par \par \par \par <% \par set conn = Server.CreateObject("ADODB.Connection") \par \par sConnString = "Provider=SQLOLEDB.1;User ID=user;Password=password;Persist Security Info=True;Initial Catalog=MyDatabase;Data Source=MySQLServer;" \par conn.open sConnString \par set rs = conn.Execute("SELECT * FROM MyTable") \par RecordsetToTable rs \par set rs = nothing \par conn.close \par set conn = nothing \par %> \par \par India web developer web development India | India web development company India ecommerce web developer \par \par } |
Render an ADO Recordset as an HTML Table |