Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem using Java and Microsoft Access

Status
Not open for further replies.
May 13, 2002
75
GB
Hi,

i have a small appliction that talks to a Access database. I can create the connection fine and issue queries no problem. The problem i am having is with a field containing a space. So i have a query..

select * from [List prices] where [Catalogue No] = "100013"

which runs fine in access, but when i run it from
Code:
Statement s = conn.createStatement();
String SQL = "select * from [List prices]  where [Catalogue No] = \"100013\""
s.execute(SQL);
i get an error

Error: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

Any ideas ?

Alistair [monkey]
 
Ok, found the answer, stupid really...

Code:
String SQL = "select * from [List prices]  where [Catalogue No] = '100013'"


Alistair [monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top