File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Failed to insert a record into MSAcess Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Failed to insert a record into MSAcess" Watch "Failed to insert a record into MSAcess" New topic

Failed to insert a record into MSAcess

arun mahajan
Ranch Hand

Joined: Dec 07, 2001
Posts: 305
I am trying with the following code to insert a record into the MS Access database...It prints me on system that it has inserted a record but it never did same...Am I doing something wrong or there is some other problem?
I am using following:
1. Windows 2000
2. MS Access 2000
3. JDK 1.3.0 ( also tried with 1.4.0)
To Connect with database

To insert a record(tried using Preapared and Simple Statement:

David O'Meara

Joined: Mar 06, 2001
Posts: 13459

If you ran a search in the JDBC forum, you'd find that this is a common problem with the JDBC-ODBC bridge.
Solution: either make sure you close the connection, set autocommit(true) before hand, or do a dummy read (ie a search that you don't care about the results of) after the insert or update.
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
To The JDBC Forum...

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link:
subject: Failed to insert a record into MSAcess
It's not a secret anymore!