This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in generating query in MSAccess

 
parag dharmadhikari
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic