%@ Language=VBScript %> <% Option Explicit %> <% Dim StartTime, EndTime StartTime = Timer Dim objCN ' ADO Connection object Dim objRS ' ADO Recordset object Dim strsql ' SQL query string Dim strTemp ' a temporary string ' Create a connection object Set objCN = Server.CreateObject("ADODB.Connection") ' Connect to the data source objCN.ConnectionString = "DSN=datasource" objCN.Open ' Prepare a SQL query string strsql = "SELECT * FROM tblData" ' Execute the SQL query and set the implicitly created recordset Set objRS = objCN.Execute(strsql) ' Write out the results in a table by concatenating into a string Response.write "
" & objRS("field1") & " | " strTemp = strTemp & "" & objRS("field2") & " | " strTemp = strTemp & "" & objRS("field3") & " | " strTemp = strTemp & "" & objRS("field4") & " |
processing took "&(EndTime-StartTime)&" seconds
" %>