Thanks,

Sorry for the typo,  my code as actually correct I think.  This is very
similar to the code I have.
RecordCount always returns -1.  I will include the stored proc below.
Should something be changed there?  I know in SQLServer you can set NOCOUNT
ON and it will prevent the count from coming back.  Is there something like
that is MaxDB that I need to switch On?

This is an excerpt from the asp page.

Const adOpenStatic = 3
CONST adUseClient = 3

cmdMain.CommandType = adCmdStoredProc
cmdMain.CommandText = "Get_User_Access"

Set prmMain = cmdMain.CreateParameter("UserId", adInteger, adParamInput, 4,
UserID)
cmdMain.Parameters.Append prmMain

rsMain.CursorLocation = adUseClient
rsMain.CursorType = adOpenStatic

Set rsMain = cmdMain.Execute()

Session("rc") = rsMain.RecordCount

Stored Procedure

CREATE DBPROC Get_User_Access (IN UserId INT) RETURNS CURSOR
AS

BEGIN
    $CURSOR = 'ACCESS_CURSOR';

    DECLARE :$CURSOR CURSOR FOR
    SELECT
        User_Access.id_Item,
        User_Access.ACCESS_KEY,
        Items.Display_Name
    FROM
        MINE.User_Access
        INNER JOIN
        MINE.Items
        ON
        User_Access.id_Item = Items.Item_ID

    WHERE
        id_user = :UserId
    ORDER BY
        Order_Prefrence;


END;



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 27, 2004 4:07 PM
To: [EMAIL PROTECTED]
Subject: RE: ADODB recordcount


That is the cursor location not the type. You have to set the cursor type to
static or keyset cursor to get the recordcount.

-----Original Message-----
From: MaxDB - Mailing List [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 27, 2004 2:47 PM
To: [EMAIL PROTECTED]
Subject: ADODB recordcount


Does anyone know how to retrieve the record count from a stored procedure
that returns a cursor?  I do not want to use the Count() function as that
will result in 2 queries.  I have set the cursortype to adUseClient but I
always get -1 for rsRecordSet.RecordCount.  Any ideas?

Thanks in advance.


--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to