-2

Duplicate of Limiting query in MS Access in PHP

I know the query of mysql in php with both limit and page number.

$result = mysql_query("SELECT * FROM tname WHERE year='$y' ORDER BY date DESC LIMIT $pg, $limit");

Here $pg is page number and $limit is the number of records per page.

Now i want to run the same query with MS Access Database with Java Platform.

I found that the keyword limit cannot be used in ms access, so found Top keyword.

So my final working query is

ResultSet rs=sta.executeQuery("SELECT top 100 * FROM tname WHERE year='$y' ORDER BY date DESC");

I want to include the page number in the ms access query... How can i do this ??? My database table has approx 3000 rows.

I want a query like the above mysql query with page number and limit which works in ms access.

Thanks in advance.

Community
  • 1
  • 1
Sunil Kumar
  • 622
  • 1
  • 12
  • 33
  • possible duplicate of [How to do MS Access database paging + search?](http://stackoverflow.com/questions/6914637/how-to-do-ms-access-database-paging-search) – Christian Specht Feb 25 '12 at 13:54

1 Answers1

0

Access has no "easy" built-in support for paging like MySQL's LIMIT, but it's possible anyway.
Take a look at this:
How to do MS Access database paging + search?

Community
  • 1
  • 1
Christian Specht
  • 35,843
  • 15
  • 128
  • 182