URGENT(COUNTING OF RECORD IN DATAABSE USING ASP)

Discussion in 'ASP General' started by Daniel Ng, Oct 1, 2004.

  1. Daniel Ng

    Daniel Ng Guest

    Hi all, may i know how to write a simple code using asp to count the
    number of record in the Access and display the figure out... Thanks...

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Daniel Ng, Oct 1, 2004
    #1
    1. Advertising

  2. <%
    Dim oADO, oRS, sSQL
    sSQL = "SELECT COUNT(UniqueID) FROM tableName"
    Set oADO = CreateObject("ADODB.Connection")
    oADO.Open "your connection string, www.connectionstrings.com"
    Set oRS = oADO.Execute(sSQL)
    Response.Write "Record count is " & oRS.Fields.Item(0).Value
    oRS.Close : Set oRS = Nothing
    oADO.Close : Set oADO = Nothing
    %>

    Some will say to do a COUNT(*). I personally count a column that I know
    will never have any nulls, such as whatever is the primary key in the table.

    Ray at work

    "Daniel Ng" <> wrote in message
    news:...
    >
    >
    > Hi all, may i know how to write a simple code using asp to count the
    > number of record in the Access and display the figure out... Thanks...
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Ray Costanzo [MVP], Oct 1, 2004
    #2
    1. Advertising

  3. Tom Kaminski [MVP], Oct 1, 2004
    #3
  4. Why are all of your questions URGENT AND IN ALL CAPS???

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    "Daniel Ng" <> wrote in message
    news:...
    >
    >
    > Hi all, may i know how to write a simple code using asp to count the
    > number of record in the Access and display the figure out... Thanks...
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Aaron [SQL Server MVP], Oct 1, 2004
    #4
    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. MRW
    Replies:
    0
    Views:
    364
  2. Jimmy Tran
    Replies:
    1
    Views:
    225
    Dan Brussee
    Oct 3, 2003
  3. Guest
    Replies:
    1
    Views:
    241
    Alex G
    Jan 9, 2004
  4. Maximus
    Replies:
    2
    Views:
    181
    Bob Barrows [MVP]
    Apr 12, 2007
  5. edwardfredriks

    counting up instead of counting down

    edwardfredriks, Sep 6, 2005, in forum: Javascript
    Replies:
    6
    Views:
    186
    Dr John Stockton
    Sep 7, 2005
Loading...

Share This Page