Forums Register Login
Last record is not inserted
Hi wagner,

Thank u 4 ur response.

In my code i m not using the loop.i just tried to insert only one record. while i was doing so, i got no errors. and the record was not inserted. but when i tried with the 2 records using separate 'insert' command it was working.

When i inserted 2 records, i could not insert the last one(second one).
when i inserted 3 records, i could not insert the last one( third one).
can you paste loop part of your code
Did you do a commit after the inserts? If not, you need to.
Hi crump,

Thank u for ur response. but i tried with that it is not working.

when i just tried to do insert, this happens.

when i tried to insert and read the records from the same table it is working. i dont know y???

[ September 29, 2004: Message edited by: ganapathy gopinathan ]
Hi Chandra,

Here is my code,

This is working fine in my friend's system, but i m getting this problem while i m working in my system.

Thank u
Try executeUpdate()
u = you
ur = you are, you're
4 = for
y = why
i m = I'm
Please don't be lazy. Contractions make posts harder to read. Are large proportion of JavaRanch users don't have English as their first language, so combining contractions with spelling and grammar errors just serves to make communication harder when we should be trying to make it easier. Thanks.

Please give us more information. If you are using MS Access and the JDBC-ODBC bridge, this is a common problem, you'll find several hundred threads discussing it in this forum. The simple solution is either set autoCommit to true or do a 'dummy read' to flush the connection.
Sorry for the inconvenience, near after i will follow your request.

yes, i am using JDBC-ODBC driver with MS-ACCESS.

Is the problem in the MS-ACCESS or in JDBC-ODBC?
where i have to use the 'autocommit'?
Is it in MS-ACCESS or in my coding?

Thank you,
[ September 30, 2004: Message edited by: ganapathy gopinathan ]
No problem.

I believe the issue is caused by the JDBC-ODBC driver. It was only designed as a quick fix to bridge the gap between the two technologies and has outgrown its purpose. It was never meant for production systems and has greater issues than this one!

It appears the driver caches queries and needs 'one more request' to make sure the previous one gets flushed, hence the 'dummy select' at the end. Presonally I always set the auto commit, but then I try not to use Access anyway.

I hope your problem is fixed.
rubbery bacon. rubbery tiny ad:
Why should you try IntelliJ IDEA ?

This thread has been viewed 902 times.

All times above are in ranch (not your local) time.
The current ranch time is
Aug 19, 2018 21:48:45.