|ODBC dBase driver - strange exception [message #760817]
||Mon, 05 December 2011 11:06
Registered: September 2011
Hi. I have an application that reads content from an Excel file, then process it and writes it to some databases. It works fine, except that sometimes it crashes and throws this: |
(Gui.java) Operatie.start() SQL Exception Run :[Microsoft][ODBC dBase Driver] The Microsoft Jet database engine could not find the object 'Sheet1$'. Make sure the object exists and that you spell its name and the path name correctly.
java.sql.SQLException: [Microsoft][ODBC dBase Driver] The Microsoft Jet database engine could not find the object 'Sheet1$'. Make sure the object exists and that you spell its name and the path name correctly.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(Unknown Source)
Now, the weird thing: As you see, it throws this exception as the file is not correctly specified and has some problems finding the Sheet1$. But if I close the program, then reopen it, works just fine, in exactly the SAME conditions. Just close, reopen and it works.
Any ideas? Thank you!
LE: I thought that because the instructions being executed so fast, the program reaches the query instruction, before the connection to excel file is completed, so it obviously cannot find the sheet, but after I start it again, the connection is already done, and can work with it. I also mention that I close the connection in a finally block, after the try/catch. Am I right / wrong?
[Updated on: Mon, 05 December 2011 11:13]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02637 seconds