sp_helplogins, nextrecordset

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

  1. #1

    Default sp_helplogins, nextrecordset

    Hi,

    I am executing the sp_helplogins on my database, in an
    effort to obtain all the databases and roles a user has,
    for usage in an ASP menu of sorts.

    sp_helplogins returns 2 recordsets, the first of which I
    could care less about. The second contains all the
    records I want to parse through.

    It never moves to the next record though. It only prints
    out (and continuously prints out) the first record.

    What's wrong here?
    Thanks!


    <snippet>

    cSql = "EXEC sp_helplogins '" & cOffID & "'"
    set oRs=oConn.execute(cSql)

    oRs = oRs.NextRecordset
    Do While Not oRs.EOF
    Response.Write oRs("DBName")
    Response.Write oRs("UserName")
    ' this prints out the first record, over and over...
    oRs.MoveNext
    Loop

    <end snippet>
    Sharon Guest

  2. Similar Questions and Discussions

    1. Using NextRecordset errors
      Does rs.nextrecordset not work when using Access/Jet? I can get it to work when I am connecting to a sql database but not an Access database. ...
  3. #2

    Default Re: sp_helplogins, nextrecordset

    See inline:
    Sharon wrote:
    > Hi,
    >
    > I am executing the sp_helplogins on my database, in an
    > effort to obtain all the databases and roles a user has,
    > for usage in an ASP menu of sorts.
    >
    > sp_helplogins returns 2 recordsets, the first of which I
    > could care less about. The second contains all the
    > records I want to parse through.
    >
    > It never moves to the next record though. It only prints
    > out (and continuously prints out) the first record.
    >
    > What's wrong here?
    > Thanks!
    >
    >
    > <snippet>
    >
    > cSql = "EXEC sp_helplogins '" & cOffID & "'"
    > set oRs=oConn.execute(cSql)
    >
    > oRs = oRs.NextRecordset
    this should be
    Set oRS = oRs.NextRecordset
    > Do While Not oRs.EOF
    > Response.Write oRs("DBName")
    > Response.Write oRs("UserName")
    > ' this prints out the first record, over and over...
    > oRs.MoveNext
    > Loop
    >
    > <end snippet>
    See if the above change fixes it. If not, I'll try to reproduce the problem.

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

  4. #3

    Default Re: sp_helplogins, nextrecordset

    That worked!!! THANK YOU.
    Sharon
    >-----Original Message-----
    >See inline:
    >this should be
    >Set oRS = oRs.NextRecordset
    >
    >See if the above change fixes it. If not, I'll try to
    reproduce the problem.
    >
    >Bob Barrows
    >
    >--
    >Microsoft MVP -- ASP/ASP.NET
    >Please reply to the newsgroup. The email account listed
    in my From
    >header is my spam trap, so I don't check it very often.
    You will get a
    >quicker response by posting to the newsgroup.
    >
    >
    >.
    >
    Sharon 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