• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 246
  • Last Modified:

Database(mdb) query with a Like '*' not working

Hello,

I am trying to query an mdb database.  The query needs to have a "Where _ Like '*'" part in it (wildcard), but that gives me an error in ASP (specifically, it says either bof or eof is true, or the recordset has been deleted).  If I put a value in between the 's I get results, but not with a wildcard.  My query works just fine in Access, but not when I port it to the web.  Any ideas?

0
lastexit
Asked:
lastexit
  • 4
  • 4
  • 2
  • +2
1 Solution
 
MannSoftCommented:
I dont think you can use that.  LIKE 'BLAH*' or LIKE '*BLAH' should work, but simply using LIKE '*' doesnt work here either.  And its kind of redundtant anyway.  Why use

SELECT * FROM TheTable WHERE TheColumn LIKE '*'

when

SELECT * FROM TheTable

does the exact same thing.
0
 
ASPGuruCommented:
does "Where _ Like '%'" work?

ASPGuru
0
 
fritz_the_blankCommented:
Here is the deal:

When working in Access proper, use the 'S*'

When connecting via ASP, use Where Like 'S%'

to get all fields starting with S.

Fritz the Blank
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
arbertCommented:
Doesn't matter what you connect with--Access always wants a % sign and SQL Server likes to use the *.....

Brett
0
 
ASPGuruCommented:
@arbert: simply wrong


ASPGuru
0
 
fritz_the_blankCommented:
I think there is a wee bit of dislexia in arbert's answer.

In the query designer of Access, you have to use the * as the wildcard character. In most other DBMS, and when using ADO, the % is what is usually needed.

ASP Guru was the first to post the correct answer here (in my humble opinion).

Fritz the Blank
0
 
arbertCommented:
Oops, sure enough...Thanks for the SIMPLY Wrong ASPGuru--very constructive.....
0
 
babyprisCommented:
I agree with fritz_the_blank... since the * wildcard doesn't work via web, how about using another way? substring function instead?

tell me how you go. I would like to know how you solve this prob. thanks.
0
 
fritz_the_blankCommented:
Babypris--

It is just as ASPGuru suggested:

If you want all fields from a table where a particular field begins with "S", the it would be:

" SELECT * FROM tblTableName WHERE objField LIKE 'S%' "

You would only use the * when testing the query within Access.

Fritz the Blank
0
 
fritz_the_blankCommented:
Hey, why the grade of B here? Didn't this solve your problem?

Fritz the Blank
0
 
ASPGuruCommented:
that's exactly what i just wanted to ask... :-)

ASPGuru
0
 
ASPGuruCommented:
@lastexit:
if it was a mistake(B is default) then you can post a change request on the community support:
http://www.experts-exchange.com/Community_Support/


ASPGuru
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 4
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now