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 Problem with Access 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 "Problem with Access" Watch "Problem with Access" New topic

Problem with Access

Timothy Marks

Joined: Sep 08, 2003
Posts: 4
I am having a problem with Access and seem to be able to make no progress. Maybe someone can help.
When I execute the following sql query in Access, it returns (in my DB) 3 rows:
Select Project.* from Customer INNER JOIN Project ON Customer.ID = Project.Cust_ID WHERE ((Cust.Name) Like "*Abc*");
When I try the same query with Java, I get an SQLException. I don't know what it would say in English, but something about 1 parameter expected but too few are given.
When I change the " to ', it executes without an exception, but returns 0 rows.
When I change Like to =, it works fine.
Does anyone have any idea what the problem could be?
[ September 08, 2003: Message edited by: Timothy Marks ]
Timothy Marks

Joined: Sep 08, 2003
Posts: 4
Solved it. Seems that in Access,

Is legal and returns the expected rows, but if you are accessing the data programmatically, you must

Just another useless inconsistency that makes everything Billy does so darned difficult
I agree. Here's the link:
subject: Problem with Access
It's not a secret anymore!