Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

response.write a recordset result

Status
Not open for further replies.

aonefun

Technical User
May 21, 2007
79
US
I am aware that for troubleshooting purposes I can response.write a recordset result to see real time results based on current parameter values.

Where do I place this response.write code in relation to the recordset code?
 
Here is an example of using Response.Write on the left side:
[tt]
Response.Write "Hello World"

^ ^
| |
Left Right
[/tt]
 
And where in relation to the recordset code?

Before this line of code?:
Recordset2.Source = "SELECT ManufacturerPartNumber, ProductFamily FROM Products
 
You'd want to populate the recordset first so it actually contains some values.

Otherwise the the Response.Write won't have anything to show.
 
my recordset is already populated. Now how do I say that I would like to Response.Write Recordset1?

 
The code will depend on what you are trying to do...


What do you want to send to the browser:
1. One or a few field values.
2. Every row in the recordset.
3. An xml representation of a recordset object that can be reconsituted on the client.


For #1 you might use something like this:[tt]
Response.Write "Part#" & Recordset2("ManufacturerPartNumber")
[/tt]

For #2 use the [tt]GetRows[/tt] method of the recordset object to return the recordset as a two diminsional array and then construct a loop to Response.Write the contents of the matrix.

For #3 use the [tt]Save[/tt] method of the recordset object to persist the object as an xml file and then sent it to the browser using Response.Write
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top