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


Richard Robbins
Ranch Hand

Joined: Mar 07, 2001
Posts: 66
I have created an Access database file called ReceiveProcessTest.mdb with a table called Employees. I am testing querying the table, but I am having trouble. Here is my code:

String data = "jdbc dbc eluxeCD";
Connection receiveQueueConnection = DriverManager.getConnection(data, "", "");
Statement writeToQueue = receiveQueueConnection.createStatement();
ResultSet receiveRec = writeToQueue.executeQuery("SELECT LastName FROM " +
"ReceiveProcessTest.mdb Employees WHERE FirstName LIKE Richard");
An exception keeps being thrown with this message:

Error: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] The Micr
osoft Jet database engine cannot find the input table or query 'mdb'. Make sure
it exists and that its name is spelled correctly.

The Data Source administrator shows that there are two "User DSN" drivers installed: DeluxeCD and MS Access Database.
If anyone has any solution to this error, please let me know.

Richard Robbins is one of the founders of, a resource for free website templates and Photoshop tutorials. He also consults for an online boutique selling baptism dresses and christening gowns.
Terry McKee
Ranch Hand

Joined: Sep 29, 2000
Posts: 175
Just a simple change in your sql statement will get rid of the error. You have the following:
SELECT LastName FROM ReceiveProcessTest.mdb Employees WHERE FirstName LIKE Richard"
You don't need to mention the database name since the jdbc dbc Url already defines it. Also I believe the LIKE argument needs single quotes around it. Change the sql statement to the following:
"SELECT LastName From Employees WHERE FirstName Like 'Richard'"
Hope this helps.
I agree. Here's the link:
subject: JDBC
jQuery in Action, 3rd edition