You can create a table variable inside your code and insert the data from
the cursor into it. Finally, return the table variable back to your ASP.
Here is a pseudo code:

CREATE PROCEDURE ...AS
BEGIN
DECLARE yourCursor CURSOR FOR ...
DECLARE tempTable TABLE (LogDate DATETIME, Users INT)

OPEN yourCursor
FETCH ...
WHILE (FETCH_STATUS = 0)
BEGIN
INSERT INTO tempTable (LogDate, Users) SELECT LogDate, NewUsers
SET ...
FETCH...
SET ...
END
CLOSE yourCursor
DEALLOCATE yourCursor

SELECT * FROM tempTable
END

Note that I have not tested this procedure explicitly, so you need to fill
in the gaps.
--
HTH,
SriSamp
Please reply to the whole group only!

"Post Mortem" <postmrtmnetvision.net.il> wrote in message
news:%239PZUUIQDHA.3020TK2MSFTNGP10.phx.gbl...
> Hi all
>
> how does the cursor return data to an ASP recordset?!
> as usual? as a table?
>
> cause i keep getting errors with that
> here is my Stored Procedure
>
> CREATE PROCEDURE CursorTest
> (
> StartDate varchar(50),
> EndDate varchar(50),
> CompanyId int
>
> )
>
>
> AS
> DECLARE UserDetail_Curs CURSOR
> FOR SELECT LogDate,TotalUsers FROM RegisteredUsers WHERE Logdate
BETWEEN
> convert(char(18),StartDate,101) AND convert(char(18),EndDate,101)
AND
> CompanyId = CompanyId
> ORDER BY LogDate Asc
>
>
> DECLARE NewUsers int,
> LogDate varchar(50),
> TmpUsers int,
> NextUsers int
>
> OPEN UserDetail_Curs
>
> FETCH UserDetail_Curs INTO LogDate ,NextUsers
>
>
>
> WHILE FETCH_STATUS = 0
> BEGIN
>
>
> Select ( cast (NewUsers as char)) as NewUsers , LogDate as
LogDate
>
> set TmpUsers = NextUsers
>
> FETCH UserDetail_Curs INTO LogDate ,NextUsers
>
> Set NewUsers = cast(NextUsers as int) - cast(TmpUsers as int )
>
>
> End
>
> Close UserDetail_Curs
> DeAllocate UserDetail_Curs
> GO
>
>
> the problem is that it send a different row for every result
> how can i get all the results in one table?!
> and can i retrieve it as usual in ASP?
> Recordset.Fields("NewUsers") ....etc..etc
>
> thanx a million
>
>
>