recordset passing

Results 1 to 2 of 2

Thread: recordset passing

  1. #1
    Ian Hoppes Guest

    Default recordset passing

    i am using a series of html/asp pages to get a search variable from an html form, perform the search using an asp sql query, and then i want to pass the resulting recordset to a generic results asp page to display the recordset. how can the last part be accomplished?<BR><BR>thanks,<BR>ian<BR>ian@shelby. net

  2. #2
    Join Date
    Dec 1969
    Posts
    59

    Default RE: recordset passing

    Ian-<BR>You can build your results page&#039s HTML into the same page that executes your query and return the field values from the recordset created from your query. A simple example:<BR><BR>&#060;%<BR>Set myRS = Server.CreateObject("ADODB.Recordset")&#039create RSobject<BR>mySql = "SELECT * FROM myTablesName" &#039build SQL statement<BR>myRS.Open mySql, "yourDSNnamehere", 1, 3, 1 &#039open recordset<BR>myRs.MoveFirst &#039move to first record in the recordset<BR>&#039now start building your HTML<BR>&#037;&#062;<BR>&#060;HTML><BR>&#060;BODY> <BR>&#060;%<BR>Do While Not myRS.EOF &#039start loop to go through all records <BR>&#037;&#062;<BR>&#060;!-- return records to HTML --><BR>The recordtitle would be &#060;%=myRS("recname")&#037;&#062; <BR>The recordauthor would be &#060;%=myRS("author")&#037;&#062;<BR>&#060;!-- and so on --><BR>&#060;%<BR>myRS.MoveNext &#039move to the next record in the recordset<BR>Loop <BR>myRS.Close<BR>Set myRS = Nothing<BR><BR>&#037;&#062;<BR>&#060;/BODY><BR>&#060;/HTML><BR><BR>Hope this helps ya-<BR><BR>ted - &#060;a href="mailto:etedwood@yahoo.com">etedwood@yahoo.co m&#060;/a><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •