Ciao a tutti.

Ho questo codice che utilizzo per paginare dati asp+mysql; funziona quasi tutto soltanto quando applico queste condizioni le query invece di restituirmi il numero dei records selezionati o tutti i records mi restituiscono sempre e solo i primi 5 records, perchè?:

codice:
strRecs = request.querystring("recs")
strFilter = request.querystring("filter")


if strRecs <> "" then
  intRecordsPerPage = strRecs
elseif strFilter <> "" then
  intRecordsPerPage = 10000
else
  intRecordsPerPage = 5
end if

'QUERY SELECT

if strRecs <> "" then
  intRecordsPerPage = strRecs
  strSql = "SELECT * from Gest LIMIT 1, "& intRecordsPerPage
end if

if strFilter <> "" then
  strSql = "SELECT * from Gest asc LIMIT 1, "& intRecordsPerPage
end if

.....


'QUERY COUNT

if strRecs <> "" then
  intRecordsPerPage = strRecs
  sql = "SELECT COUNT(*) from Gest LIMIT 1, "& intRecordsPerPage
end if

if strFilter <> "" then
  sql = "SELECT COUNT(*) from Gest LIMIT 1, "& intRecordsPerPage
end if