# ASP Functions

**URL:** https://forum.kirupa.com/t/asp-functions/157726
**Category:** programming
**Created:** [August 3, 2005, 9:37pm UTC](https://forum.kirupa.com/t/asp-functions/157726 "2005-08-03T21:37:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dinkumrocks](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@dinkumrocks](https://forum.kirupa.com/u/dinkumrocks)
#### Post date: [August 3, 2005, 9:37pm UTC](https://forum.kirupa.com/t/asp-functions/157726/1 "2005-08-03T21:37:07Z")

</div>

Hey guys.

Im making a paging project with ASP and MySQL. I’m using the limit and offset fuctions in MySQL to make the paging possible

Ok. hte problem

I have a function that outputs the total # of records. this is the function.

```
Function getCount(sql)
    Set RScount = Server.CreateObject("ADODB.Recordset")
    RScount.Open "SELECT Count(*) as rscount FROM " & sql & ";", Conn
    Response.Write RScount("rscount")
    RScount.close
    set RScount = Nothing
End Function

```

that works perfectly

the problem is that when i want to use the total number of record to compare with the paging buttons, it prints the total records.

I hope that makes sense

heres some more code

like if i did this…

\<%If pagebigcount \< getCount(“news”) then%\> | \<a href=“options.asp?action=3&page=\<%=intPage + 1%\>”\>Next 5\</a\>\<%end if%\>

if i had 7 records, it puts out …

7 Next 5

any ideas?

this is probably really confusing, if it is, sorry. tell me and ill try harder to explain it.

thanks for any help  
-Naaman
