Ask a Question related to ASP Database, Design and Development.
-
Sharon #1
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
-
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. ... -
Bob Barrows [MVP] #2
Re: sp_helplogins, nextrecordset
See inline:
Sharon wrote:this should be> 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
Set oRS = oRs.NextRecordset
See if the above change fixes it. If not, I'll try to reproduce the problem.> 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>
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
-
Sharon #3
Re: sp_helplogins, nextrecordset
That worked!!! THANK YOU.
Sharon
reproduce the problem.>-----Original Message-----
>See inline:
>this should be
>Set oRS = oRs.NextRecordset
>
>See if the above change fixes it. If not, I'll try toin my From>
>Bob Barrows
>
>--
>Microsoft MVP -- ASP/ASP.NET
>Please reply to the newsgroup. The email account listedYou will get a>header is my spam trap, so I don't check it very often.>quicker response by posting to the newsgroup.
>
>
>.
>Sharon Guest



Reply With Quote

