Step 3: Send the Data
Now that you have a Recordset, you need to send it to the client by saving it as XML to the ASP Response object. Add the following code to the bottom of XMLResponse.asp:
Response.ContentType = "text/xml" Response.Expires = 0 Response.Buffer = False Response.Write "<?xml version='1.0'?>" & vbNewLine adoRec.save Response, adPersistXML adoRec.Close Set adoRec=Nothing %>
Notice that the ASP Response object is specified as the destination for the Recordset Save method. The destination of the Save method can be any object that supports the IStream interface, such as an ADO Stream object, or a file name that includes the complete path to which the Recordset is to be saved.
Save and close XMLResponse.asp before going to the next step. Also copy the adovbs.inc file from C:\Program Files\Common Files\System\Ado folder to the same folder where you have the XMLResponse.asp file.