%@ Language=VBScript %> <% Option Explicit %> <% Dim StartTime, EndTime StartTime = Timer Dim objCN ' ADO Connection object Dim objRS ' ADO Recordset object Dim strsql ' SQL query 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 Field1,Field2,Field3,Field4 FROM tblData" ' Execute the SQL query and set the implicitly created recordset Set objRS = objCN.Execute(strsql) ' Write out the results using GetString in a loop Response.write "
" Do While Not objRS.EOF Response.write objRS.GetString(2,30,vbTab,vbCrLf) Loop Response.write "" objRS.Close objCN.Close Set objCN = Nothing Set objRS = Nothing EndTime = Timer Response.write "
processing took "&(EndTime-StartTime)&" seconds
" %>