HOWTO: Accessing The Recordset DTC's Underlying ADO RecordsetID: Q193231
|
The underlying ActiveX Data Objects (ADO) Recordset created when a Recordset Design-time control (DTC) is included on an Active Server Page (ASP) can be accessed from ASP script using the getRecordSource() method of the Recordset Design-Time Control.
The getRecordSource() method of the Recordset DTC returns a copy of the ADO Recordset that is the source of the Recordset DTC. The following example sets an object to be the source ADO Recordset of a Recordset DTC and creates an HTML table of the field names and values.
<%
'
'Where Recordset1 is the name of your Recordset DTC
'
Dim tempRS
Set tempRS = Recordset1.getRecordSource()
Response.Write "<table border=1 cellpadding=4>"
Response.Write "<tr>"
For I = 0 To tempRS.Fields.Count - 1
Response.Write "<td><b>" & tempRS(I).Name & "</b></td>"
Next
Response.Write "</tr>"
Do While Not tempRS.EOF
Response.Write "<tr>"
For I = 0 To tempRS.Fields.Count - 1
Response.Write "<td>" & tempRS(I) & "</td>"
Next
Response.Write "</tr>"
tempRS.MoveNext
Loop
Response.Write "</table>"
Set tempRS = Nothing
%>
Additional query words:
Keywords : kbADO kbCtrl kbVisID600 kbGrpASP
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: May 27, 1999