Solved

JDBC select all rows in order

Posted on 2002-07-12
1
157 Views
Last Modified: 2012-05-04
Hi All,
 I would like to collect all the rows of a small MS Access database in the order that they are listed in the database. I am using JDBC in JSP pages.

My SQL statement is simple:
"SELECT * from NavTable"

Unfortunately, the recordset does not return the rows in the same order.  

Everything is re-arranged.

What can I do?
TIA DoughBoy
0
Comment
Question by:DoughBoy
1 Comment
 
LVL 28

Accepted Solution

by:
TextReport earned 50 total points
ID: 7151050
You need to tell your SELECT statement the specific order you wish it to return in, eg SELECT * FROM navtable ORDER BY field1, field2 ...

If you are not able to sort by fields and you you want data entry order then there is no way you can get this as the table stands. You can create an AutoNumber field and this will work with new tables.

Cheers, Andrew
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question