File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes problem in generating query in MSAccess Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "problem in generating query in MSAccess" Watch "problem in generating query in MSAccess" New topic
Author

problem in generating query in MSAccess

parag dharmadhikari
Greenhorn

Joined: Dec 01, 2000
Posts: 8
HI all,
I want to generate a query for MS Access.I have to build it using MSAccess wild char "*".
my query statement is
query="select * from "+table+" where "+colarr.elementAt(0)+" like '"+valarr.elementAt(0)+"*"+"' ";
where all variables are decleared properly. here my problem is there is no syntax or runtime error but after firing the query I can not get the output as resultset is zero though data is present. Without wild char. it works fine.
can anybody pls help me

Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

When I use MSAccess and java, the wild card is '%'. try the same query using '%' and you should be fine
Jamie
Jason Kilgrow
Ranch Hand

Joined: May 21, 2001
Posts: 47
Originally posted by parag dharmadhikari:
HI all,
I want to generate a query for MS Access.I have to build it using MSAccess wild char "*".
my query statement is
query="select * from "+table+" where "+colarr.elementAt(0)+" like '"+valarr.elementAt(0)+"*"+"' ";
where all variables are decleared properly. here my problem is there is no syntax or runtime error but after firing the query I can not get the output as resultset is zero though data is present. Without wild char. it works fine.
can anybody pls help me

Try some sample queries in Access before you code them.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in generating query in MSAccess
 
Similar Threads
how to execute complex queries
Stored procedures in MSAcess
SQL query
how to insert multiple value in database
Hibernate