Command Object and Recordcount

Results 1 to 2 of 2

Thread: Command Object and Recordcount

  1. #1
    Tarun Rokadiya Guest

    Default Command Object and Recordcount

    I have a query in an Access db to which i pass a parameter and call it using the command object. <BR>here is the code...<BR><BR>Set objCmd=Server.CreateObject("ADODB.Command")<BR>Set objCmd.ActiveConnection=Session("conn")<BR>objCmd. CommandText="{CALL qCourseHistory(&#039%"&strSUID&"%&#039)}"<BR>Set rs=Server.CreateObject("ADODB.Recordset") <BR>Set rs=objCmd.Execute<BR><BR>The problem is that whenever i try and do a rs.Recordcount<BR>it always gives me a -1 regardless of the number of records. How do i get the number of records returned ?!<BR>

  2. #2
    Paul M Guest

    Default RE: Command Object and Recordcount

    You will always get a result of -1 if your record cursor is equal to adOpendynamic or adOpenForwardOnly, you need to use AdOpenstatic or adOpenKeyset. I am not an expert on Recordset Cursors, but this is your problem. Try searching for info on Recordset Cursors.<BR><BR>Paul

Posting Permissions

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