problem in getting Maximum value from column

i have a table with 5 fields in it.i want to get field say accountno to be incremented each time when a new record is to be inserted by checking whether number is not duplicated. how to get max value in accountno column and incremented by 1 or 2 in MS-Access database....please help me!!!!

Thanks in advance......

[326 byte] By [MeenaMahalingama] at [2007-11-27 4:52:45]
# 1
Statement max = conn.createStatement("Select max(accountno) from whatsitsname");ResultSet rs = max.executeQuery();rs.next();int maxValue = rs.getInt(1);
DrClapa at 2007-7-12 10:06:52 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
MS Access has an auto increment identity field.
jschella at 2007-7-12 10:06:52 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...