Stepping through Recordsets

Results 1 to 2 of 2

Thread: Stepping through Recordsets

  1. #1
    Ronnie Brown Guest

    Default Stepping through Recordsets

    I am writing out records from a database by stepping through it and writing each record out from a particular field e.g.<BR><BR>objRS.movefirst<BR>do while not (objRS.eof)<BR><BR> response.write objRS("Dept") <BR> response.write ("&#060;P&#062;")<BR> response.write objRS("Name")<BR><BR>objRS.movenext<BR>loop<BR><BR >However, as the record &#039;Dept&#039; does not contain unique text, I only want to write it each time it changes. Currently it looks like this (for example):<BR><BR>I.T.<BR>Ronnie Brown<BR>I.T.<BR>Ronnie Smith<BR>I.T.<BR>Ronnie Jones<BR><BR>H.R.<BR>David Jones<BR>H.R.<BR>David Smith<BR>H.R.<BR>David Brown<BR><BR>Whereas I really want it to look like this (for example):<BR><BR>I.T.<BR>Ronnie Brown<BR>Ronnie Smith<BR>Ronnie Jones<BR><BR>H.R.<BR>David Jones<BR>David Smith<BR>David Brown<BR><BR>Thanks for your help.

  2. #2
    Join Date
    Dec 1969

    Default RE: Stepping through Recordsets

    you need to look into normalising your data (if you haven&#039;t already) and using datashaping<BR><BR> has a data shaping tutorial, and touches on normalisation in the INNER JOINS article - you may find it useful<BR><BR>j

Posting Permissions

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