Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Recordset is returning -1 recordcount

Recordset is returning -1 recordcount

Scheduled Pinned Locked Moved Web Development
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kiran S S
    wrote on last edited by
    #1

    I have tried simple stored procedures to return recordset like : Select * From It is running good, giving proper out put. But If I am making it bit complicated then recordset is returning -1 recordcount e.g. : Select Count(bId) as cntBid from bTable This stored procedure is running well in SQL Server 2005, but if I am caling them in ASP pages it is returning me -1 recordcount. Please Help me

    Kiran Sajanikar

    Y K T 3 Replies Last reply
    0
    • K Kiran S S

      I have tried simple stored procedures to return recordset like : Select * From It is running good, giving proper out put. But If I am making it bit complicated then recordset is returning -1 recordcount e.g. : Select Count(bId) as cntBid from bTable This stored procedure is running well in SQL Server 2005, but if I am caling them in ASP pages it is returning me -1 recordcount. Please Help me

      Kiran Sajanikar

      Y Offline
      Y Offline
      Yusuf
      wrote on last edited by
      #2

      you seem to be asking the same question multiple times. show us all the necessary code as to how you are calling your priocedure and what your procedure looks like.

      Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]

      1 Reply Last reply
      0
      • K Kiran S S

        I have tried simple stored procedures to return recordset like : Select * From It is running good, giving proper out put. But If I am making it bit complicated then recordset is returning -1 recordcount e.g. : Select Count(bId) as cntBid from bTable This stored procedure is running well in SQL Server 2005, but if I am caling them in ASP pages it is returning me -1 recordcount. Please Help me

        Kiran Sajanikar

        K Offline
        K Offline
        Kiran S S
        wrote on last edited by
        #3

        This is stored procedure

        set ANSI_NULLS ON
        set QUOTED_IDENTIFIER ON
        go
        ALTER PROCEDURE [dbo].[test1]

        AS
        --Select * From blog
        Select Max(blogID) as cntId from blog

        ASP code to call Stored procedure Code 1:

        dim rsTemp, strSql strSql = "Exec test1"
        set rsTemp = Server.CreateObject("ADODB.Recordset")
        rsTemp.Open strSql, con, 1, 3
        Response.Write rsTemp.RecordCount

        Code 2: ------------

        dim cmd, rsTemp, strSql
        set rsWork = Server.CreateObject("ADODB.Recordset")
        set cmd = Server.CreateObject("ADODB.Command")
        cmd.ActiveConnection = con
        cmd.CommandText = "test1"
        set rsTemp = cmd.Execute
        Response.Write rsTemp.RecordCount

        Kiran Sajanikar

        1 Reply Last reply
        0
        • K Kiran S S

          I have tried simple stored procedures to return recordset like : Select * From It is running good, giving proper out put. But If I am making it bit complicated then recordset is returning -1 recordcount e.g. : Select Count(bId) as cntBid from bTable This stored procedure is running well in SQL Server 2005, but if I am caling them in ASP pages it is returning me -1 recordcount. Please Help me

          Kiran Sajanikar

          T Offline
          T Offline
          TomS45
          wrote on last edited by
          #4

          It's returning -1 due to the type of cursor the recordset is using. Google recordset cursors - you need one that's dynamic. Make a program idiot proof and a better idiot will come along.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups