• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

problem in generating query in MSAccess

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic