Loading results from 2 recordsets into an array

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Loading results from 2 recordsets into an array

    Hi all,

    I have 2 queries producing two recordsets, one listing a series of
    courses available online and the other listing the courses that the
    user has completed with a passing grade. I need to output the results
    to an HTML table that lists the available courses and puts a check
    mark beside the completed/passed courses. At this point I'm stuck,
    not being that familiar with arrays.

    Any ideas?

    Thanks

    Joel
    Joel Racicot Guest

  2. Similar Questions and Discussions

    1. Need help with loading MySQL results into a query
      Hello, I need some help figuring out why my tree component isn't being populated with my MySQL results. I have a table of categories: ParentID -...
    2. Problem getting webservice array results
      I am trying to display the results of a webservice using the WebserviceConnector. I'm using Flash cs3, publishing setting of the movie si set to...
    3. Soap::Lite Cant get array of results?
      I have a web service that returns <soap:Envelope ...> <soap:Body> <myOperationResponse xmlns="nyService"> <myOperationResult> <Wrapper>...
    4. Persisted XML Recordsets - Disconnected Recordsets - problems
      I have a recordset, client side .ASP that I save as a DOM. I pass to a server side .ASP to reconnect the recordset and update. I keep getting an...
    5. Goofy Results loading XML file. . .
      All, Quick question, typed up a simple XML file using Ultra-Edit, which is a basic text editor. I followed good readability standards for...
  3. #2

    Default Re: Loading results from 2 recordsets into an array

    I'd imagine you could return this information all in one query if you share
    your table structure and what your two current queries are.

    Ray at work

    "Joel Racicot" <j_racicot@hotmail.com> wrote in message
    news:39f0c695.0311041259.629d0643@posting.google.c om...
    > Hi all,
    >
    > I have 2 queries producing two recordsets, one listing a series of
    > courses available online and the other listing the courses that the
    > user has completed with a passing grade. I need to output the results
    > to an HTML table that lists the available courses and puts a check
    > mark beside the completed/passed courses. At this point I'm stuck,
    > not being that familiar with arrays.
    >
    > Any ideas?
    >
    > Thanks
    >
    > Joel

    Ray at Guest

  4. #3

    Default Re: Loading results from 2 recordsets into an array

    > I have 2 queries producing two recordsets, one listing a series of
    > courses available online and the other listing the courses that the
    > user has completed with a passing grade. I need to output the results
    > to an HTML table that lists the available courses and puts a check
    > mark beside the completed/passed courses. At this point I'm stuck,
    > not being that familiar with arrays.
    Why do you need arrays? More details, please.


    Aaron Bertrand - MVP Guest

  5. #4

    Default Re: Loading results from 2 recordsets into an array

    "Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message news:<OVzGutxoDHA.2268@TK2MSFTNGP12.phx.gbl>...
    > > I have 2 queries producing two recordsets, one listing a series of
    > > courses available online and the other listing the courses that the
    > > user has completed with a passing grade. I need to output the results
    > > to an HTML table that lists the available courses and puts a check
    > > mark beside the completed/passed courses. At this point I'm stuck,
    > > not being that familiar with arrays.
    >
    > Why do you need arrays? More details, please.
    OK, here are the details.

    Table Structures:

    Table: tblCourseMod
    Columns
    Name Type Size
    ModID Long Integer 4
    ModNum Long Integer 4
    ModName Text 255
    LessonRef Long Integer 4
    LessonName Text 255
    LessonPath Text 255
    ModType Text 50
    ModLang Text 50

    Table: tblLoginInfo
    Columns
    Name Type Size
    fldUID Long Integer 4
    fldUserID Text 25
    fldPassword Text 25
    fldUserFirstName Text 50
    fldUserLastName Text 50
    fldLastLogin Date/Time 8
    fldCreated Date/Time 8

    Table: tblTestScore
    Columns
    Name Type Size
    fldUID Long Integer 4
    fldModID Long Integer 4
    fldDateTime Date/Time 8
    fldTestScore Long Integer 4
    fldTestType Long Integer 4


    Query to get the course list of all courses
    select distinct modname, modnum from tblCourseMod where ModType =
    'retail' and lessonref = 1 order by modnum

    Query to get the completed/passed courses for the current user
    SELECT Count(*) AS [count], tblTestScore.fldModID,
    tblCourseMod.ModName
    FROM tblLoginInfo INNER JOIN (tblCourseMod INNER JOIN tblTestScore ON
    tblCourseMod.ModID = tblTestScore.fldModID) ON tblLoginInfo.fldUID =
    tblTestScore.fldUID
    WHERE (((tblLoginInfo.fldUserID)='" & Request.Cookie("login")("userid"
    &"') AND ((tblTestScore.fldTestType)=2))
    GROUP BY tblTestScore.fldModID, tblCourseMod.ModName;

    Once I've got the results of these queries, I need to match up the
    records from the second query to those from the first query in order
    to output the course list along with a checkmark or other marker
    indicating that the course has been completed.

    Does this make any sense? Am I just making this too complicated for
    nothing? Is there an easier way to do this?

    Thanks

    Joel
    Joel Racicot Guest

  6. #5

    Default Re: Loading results from 2 recordsets into an array

    You should be able to get what you want by combining the 2 queries and doing
    a left outer join between the course and score table. What DBMS are you
    using?

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    [url]www.ielearning.com[/url]


    "Joel Racicot" <j_racicot@hotmail.com> wrote in message
    news:39f0c695.0311060811.1e8ba31@posting.google.co m...
    > "Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
    news:<OVzGutxoDHA.2268@TK2MSFTNGP12.phx.gbl>...
    > > > I have 2 queries producing two recordsets, one listing a series of
    > > > courses available online and the other listing the courses that the
    > > > user has completed with a passing grade. I need to output the results
    > > > to an HTML table that lists the available courses and puts a check
    > > > mark beside the completed/passed courses. At this point I'm stuck,
    > > > not being that familiar with arrays.
    > >
    > > Why do you need arrays? More details, please.
    >
    > OK, here are the details.
    >
    > Table Structures:
    >
    > Table: tblCourseMod
    > Columns
    > Name Type Size
    > ModID Long Integer 4
    > ModNum Long Integer 4
    > ModName Text 255
    > LessonRef Long Integer 4
    > LessonName Text 255
    > LessonPath Text 255
    > ModType Text 50
    > ModLang Text 50
    >
    > Table: tblLoginInfo
    > Columns
    > Name Type Size
    > fldUID Long Integer 4
    > fldUserID Text 25
    > fldPassword Text 25
    > fldUserFirstName Text 50
    > fldUserLastName Text 50
    > fldLastLogin Date/Time 8
    > fldCreated Date/Time 8
    >
    > Table: tblTestScore
    > Columns
    > Name Type Size
    > fldUID Long Integer 4
    > fldModID Long Integer 4
    > fldDateTime Date/Time 8
    > fldTestScore Long Integer 4
    > fldTestType Long Integer 4
    >
    >
    > Query to get the course list of all courses
    > select distinct modname, modnum from tblCourseMod where ModType =
    > 'retail' and lessonref = 1 order by modnum
    >
    > Query to get the completed/passed courses for the current user
    > SELECT Count(*) AS [count], tblTestScore.fldModID,
    > tblCourseMod.ModName
    > FROM tblLoginInfo INNER JOIN (tblCourseMod INNER JOIN tblTestScore ON
    > tblCourseMod.ModID = tblTestScore.fldModID) ON tblLoginInfo.fldUID =
    > tblTestScore.fldUID
    > WHERE (((tblLoginInfo.fldUserID)='" & Request.Cookie("login")("userid"
    > &"') AND ((tblTestScore.fldTestType)=2))
    > GROUP BY tblTestScore.fldModID, tblCourseMod.ModName;
    >
    > Once I've got the results of these queries, I need to match up the
    > records from the second query to those from the first query in order
    > to output the course list along with a checkmark or other marker
    > indicating that the course has been completed.
    >
    > Does this make any sense? Am I just making this too complicated for
    > nothing? Is there an easier way to do this?
    >
    > Thanks
    >
    > Joel

    Mark Schupp Guest

  7. #6

    Default Re: Loading results from 2 recordsets into an array

    Using Access 2000. I thought of using a union query. Just
    not sure that it wouldn't be easier to load the results of
    the scores query into an array and compare them to the
    results of the courses query when I write out the course
    list. Still not sure if I'm making any sense, though.

    Thanks for the help. Any ideas appreciated as usual.

    Joel
    >-----Original Message-----
    >You should be able to get what you want by combining the 2
    queries and doing
    >a left outer join between the course and score table. What
    DBMS are you
    >using?
    >
    >--
    >Mark Schupp
    >Head of Development
    >Integrity eLearning
    >[url]www.ielearning.com[/url]
    >
    >
    >"Joel Racicot" <j_racicot@hotmail.com> wrote in message
    >news:39f0c695.0311060811.1e8ba31@posting.google.c om...
    >> "Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in
    message
    >news:<OVzGutxoDHA.2268@TK2MSFTNGP12.phx.gbl>...
    >> > > I have 2 queries producing two recordsets, one
    listing a series of
    >> > > courses available online and the other listing the
    courses that the
    >> > > user has completed with a passing grade. I need to
    output the results
    >> > > to an HTML table that lists the available courses
    and puts a check
    >> > > mark beside the completed/passed courses. At this
    point I'm stuck,
    >> > > not being that familiar with arrays.
    >> >
    >> > Why do you need arrays? More details, please.
    >>
    >> OK, here are the details.
    >>
    >> Table Structures:
    >>
    >> Table: tblCourseMod
    >> Columns
    >> Name Type Size
    >> ModID Long Integer 4
    >> ModNum Long Integer 4
    >> ModName Text 255
    >> LessonRef Long Integer 4
    >> LessonName Text 255
    >> LessonPath Text 255
    >> ModType Text 50
    >> ModLang Text 50
    >>
    >> Table: tblLoginInfo
    >> Columns
    >> Name Type Size
    >> fldUID Long Integer 4
    >> fldUserID Text 25
    >> fldPassword Text 25
    >> fldUserFirstName Text 50
    >> fldUserLastName Text 50
    >> fldLastLogin Date/Time 8
    >> fldCreated Date/Time 8
    >>
    >> Table: tblTestScore
    >> Columns
    >> Name Type Size
    >> fldUID Long Integer 4
    >> fldModID Long Integer 4
    >> fldDateTime Date/Time 8
    >> fldTestScore Long Integer 4
    >> fldTestType Long Integer 4
    >>
    >>
    >> Query to get the course list of all courses
    >> select distinct modname, modnum from tblCourseMod where
    ModType =
    >> 'retail' and lessonref = 1 order by modnum
    >>
    >> Query to get the completed/passed courses for the
    current user
    >> SELECT Count(*) AS [count], tblTestScore.fldModID,
    >> tblCourseMod.ModName
    >> FROM tblLoginInfo INNER JOIN (tblCourseMod INNER JOIN
    tblTestScore ON
    >> tblCourseMod.ModID = tblTestScore.fldModID) ON
    tblLoginInfo.fldUID =
    >> tblTestScore.fldUID
    >> WHERE (((tblLoginInfo.fldUserID)='" &
    Request.Cookie("login")("userid"
    >> &"') AND ((tblTestScore.fldTestType)=2))
    >> GROUP BY tblTestScore.fldModID, tblCourseMod.ModName;
    >>
    >> Once I've got the results of these queries, I need to
    match up the
    >> records from the second query to those from the first
    query in order
    >> to output the course list along with a checkmark or
    other marker
    >> indicating that the course has been completed.
    >>
    >> Does this make any sense? Am I just making this too
    complicated for
    >> nothing? Is there an easier way to do this?
    >>
    >> Thanks
    >>
    >> Joel
    >
    >
    >.
    >
    Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139