?
Solved

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

Posted on 2003-03-26
12
Medium Priority
?
242 Views
Last Modified: 2010-07-27
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
Comment
Question by:lastexit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
  • +2
12 Comments
 
LVL 6

Expert Comment

by:MannSoft
ID: 8211813
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
 
LVL 11

Accepted Solution

by:
ASPGuru earned 225 total points
ID: 8211852
does "Where _ Like '%'" work?

ASPGuru
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 8211858
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
Independent Software Vendors: 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!

 
LVL 34

Expert Comment

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

Brett
0
 
LVL 11

Expert Comment

by:ASPGuru
ID: 8212482
@arbert: simply wrong


ASPGuru
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 8212572
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
 
LVL 34

Expert Comment

by:arbert
ID: 8212639
Oops, sure enough...Thanks for the SIMPLY Wrong ASPGuru--very constructive.....
0
 
LVL 1

Expert Comment

by:babypris
ID: 8214975
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
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 8217780
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
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 8225725
Hey, why the grade of B here? Didn't this solve your problem?

Fritz the Blank
0
 
LVL 11

Expert Comment

by:ASPGuru
ID: 8225790
that's exactly what i just wanted to ask... :-)

ASPGuru
0
 
LVL 11

Expert Comment

by:ASPGuru
ID: 8225824
@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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question