How can count RecordSet

Discussion in 'ASP General' started by Jack, Jan 20, 2004.

  1. Jack

    Jack Guest

    Hello,
    <%@ Language=VBScript %>
    <%
    Dim shipment_db
    Dim shipmentTable
    Set shipment_db = Server.CreateObject("ADODB.Connection")
    Set shipmentTable = shipment_db.Execute("SELECT * FROM shipment")
    Response.Write shipmentTable.RecordSetCount 'This line is error
    %>
    But this program can't count recordset.
    Thank you
     
    Jack, Jan 20, 2004
    #1
    1. Advertising

  2. Jack

    Bob Barrows Guest

    Jack wrote:
    > Hello,
    > <%@ Language=VBScript %>
    > <%
    > Dim shipment_db
    > Dim shipmentTable
    > Set shipment_db = Server.CreateObject("ADODB.Connection")
    > Set shipmentTable = shipment_db.Execute("SELECT * FROM shipment")
    > Response.Write shipmentTable.RecordSetCount 'This line is error
    > %>
    > But this program can't count recordset.
    > Thank you


    As you will see in this article, the method you choose to use depends on
    your database. Always tell use the type and version of database you are
    using.

    http://www.aspfaq.com/show.asp?id=2193

    For a further explanation of the effect of cursor type on record count, see
    here:
    http://msdn.microsoft.com/library/en-us/ado270/htm/mdapro05_9.asp

    HTH,
    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows, Jan 20, 2004
    #2
    1. Advertising

  3. Jack

    Jack Guest

    It's myself.
    My DataBase is Microsoft Access 2000,linked by ODBC Driver.
     
    Jack, Jan 20, 2004
    #3
  4. Jack

    Bhaskaran.B Guest

    <%
    Dim shipment_db
    Dim shipmentTable
    Set shipment_db = Server.CreateObject("ADODB.Connection")
    Set shipmentTable = Server.CreateObject("ADODB.Recordset")
    shipmentTable .open "SELECT * FROM shipment", shipment_db ,1,1
    Response.Write shipmentTable.RecordCount
    %>

    Bj.Bhaskaran.B
    IGI - SCT

    "Jack" <> wrote in message news:#...
    > Hello,
    > <%@ Language=VBScript %>
    > <%
    > Dim shipment_db
    > Dim shipmentTable
    > Set shipment_db = Server.CreateObject("ADODB.Connection")
    > Set shipmentTable = shipment_db.Execute("SELECT * FROM shipment")
    > Response.Write shipmentTable.RecordSetCount 'This line is error
    > %>
    > But this program can't count recordset.
    > Thank you
    >
     
    Bhaskaran.B, Jan 20, 2004
    #4
  5. Jack

    Bob Barrows Guest

    Jack wrote:
    > It's myself.
    > My DataBase is Microsoft Access 2000,linked by ODBC Driver.


    Great. :)
    Now just remember to provide this information the next time you post a
    question.

    I do suggest you drop the ODBC driver and use the native Jet OLEDB provider
    instead. ODBC is being deprecated, and MS recommends using OLEDB if
    available for your database (which it is). See here for connection string
    examples:

    http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProviderForMicrosoftJet

    HTH,
    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows, Jan 20, 2004
    #5
  6. Jack

    Jack Guest

    Thank you very much
     
    Jack, Jan 20, 2004
    #6
  7. Jack

    Jack Guest

    Thank you
     
    Jack, Jan 20, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. efelnavarro09
    Replies:
    2
    Views:
    976
    efelnavarro09
    Jan 26, 2011
  2. Hung Huynh
    Replies:
    8
    Views:
    347
    Bob Barrows
    Sep 24, 2003
  3. Edward
    Replies:
    1
    Views:
    152
    Aaron Bertrand - MVP
    Dec 1, 2003
  4. tchangmian

    Recordset for page count

    tchangmian, Apr 4, 2005, in forum: ASP General
    Replies:
    1
    Views:
    130
    Bob Barrows [MVP]
    Apr 4, 2005
  5. Noozer
    Replies:
    1
    Views:
    119
Loading...

Share This Page