This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Adding new values to a table in MS Access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Adding new values to a table in MS Access" Watch "Adding new values to a table in MS Access" New topic
Author

Adding new values to a table in MS Access

Matthew Gaunt
Greenhorn

Joined: Mar 12, 2001
Posts: 12
Hi There,
Am using a MS Access database to hold data, and want to add to one of the tables using JDBC.
Under most circustances, this is not a problem.
The question is, how do I add data to a table which has an AutoNumber field as the primary key??
Best Regards
Matt Gaunt
bill bozeman
Ranch Hand

Joined: Jun 30, 2000
Posts: 1070
I haven't tried it with JDBC, but the SQL Statement would look something like this:

Since you have an autonumber, you have to list all of the fields that are going to be inserted. You don't include the autonumber since, well it is auto.
Bill
 
jQuery in Action, 2nd edition
 
subject: Adding new values to a table in MS Access
 
Similar Threads
how to move to previous record
Get index of a row
MSACCESS Connection
How to insert records in ms-access table using jdbc console application.
Ms-Access with Java Studio creator ?