record set question

Results 1 to 2 of 2

Thread: record set question

  1. #1
    Join Date
    Dec 1969

    Default record set question

    I have created a recordset that selects categories from my database.<BR>&#060;%<BR>dim rs1,rs1_numrows<BR>set rs1 = server.CreateObject("ADODB.Recordset")<BR>rs1.acti veconnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:inetpubsomewhere est est1.mdb;"<BR>rs1.source = "SELECT DISTINCT category FROM Table1 ORDER BY category"<BR> ()<BR>rs1_numrows = 0<BR>%&#062;<BR><BR>i then have a second recordset that i want to select product, price and code based on the categories that are selected in the first recordset.<BR><BR>&#060;%<BR>dim rs2,rs2_numrows<BR>set rs2 = server.CreateObject("ADODB.Recordset")<BR>rs2.acti veconnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:inetpubDev est est1.mdb;"<BR>rs2.source = "SELECT product,price,code FROM Table1 WHERE category = &#039;cateogry created in rs1&#039; ORDER BY price"<BR> ()<BR>rs2_numrows = 0<BR>%&#062;<BR><BR>this obviously doesn&#039;t work. can anyone steer me in the right direction. <BR><BR>what i want to do is display a catalog broken down into categories and then each product within that catagory is display under the category heading.<BR><BR>thanks in advance. Dave

  2. #2
    Join Date
    Dec 1969

    Default category Databases, General

    Look for the FAQ there that talks about categories and subcategories grouped under them.<BR><BR>Or see DougD&#039;s ongoing fun trying to use a CrossTab query to do the same thing. [But try the simpler way from the FAQ first.]<BR><BR><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