FOR EACH... IN recordset

Results 1 to 2 of 2

Thread: FOR EACH... IN recordset

  1. #1
    Join Date
    Dec 1969

    Default FOR EACH... IN recordset

    How can I use FOR EACH statement to perform some statement for each element in one recordset field??<BR><BR>I tried this:<BR>&#039;RS is my recordset object<BR><BR>dim subcat<BR>subcat=RS("product_subcat")<BR><BR>FOR EACH subcat IN RS<BR> response.write ...<BR>NEXT<BR><BR>but get an error message: "object doesn&#039;t support this property or method." <BR><BR>I know there is something very wrong here but don&#039;t know how to solve it! <BR>Thanks.<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default HUH?

    A recordset field is *NOT* a collection. It is a single object, with a NAME, TYPE, and VALUE. <BR><BR>So of course you can&#039;t use FOR EACH with it, since there is only one of it.<BR><BR>Your question doesn&#039;t even make sense. Toss out what you were trying to do, take a deep breath, and explain in simple terms what you want. NOT the code you want. The *RESULTS* you want.<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