how to use like operator in asp

Posted on 1999-12-01
Medium Priority
Last Modified: 2012-05-04
i am using access as backend.

i am facing problem with "like" operator.

what happens is:

1)if i am not use "*" in like operator then
tmpStr = "Select * from COLLEGE " & _
      "WHERE COLLEGE_NAME like '"     & Request.Form ("txtCollege") & "'"

      (i am not using "*" here) then it is working as "=" operator. means it will search college where college_name is exactly matches.

2)       if i am using "*" then
tmpStr = "Select * from COLLEGE " & _
      "WHERE COLLEGE_NAME like '" & Request.Form ("txtCollege") & "'*"
      it is giving error...
      error is:

            Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

            [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'COLLEGE_NAME like 'cit'*'.

line 43
Question by:Aurokripa

Accepted Solution

freshmeat earned 40 total points
ID: 2248774
use "%" instead of "*"

Author Comment

ID: 2249043
hi freshmeat,

thanks for valuable reply
we are very thankful to u & hope u will help  us in future also.


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
The video provides a quick and easy steps to migrate MBOX file to well known Outlook PST and Office 365. Besides this, it also supports and migrates more than 20 email clients of MBOX which include AppleMail, Opera, Thunderbird and SeaMonkey effortl…
If you are looking for an automated solution for backup single or multiple Office 365 user mailboxes to Outlook data file, then you can use Kernel Office 365 Backup & Restore tool. Go through the video to check out the steps to backup single or mult…
Suggested Courses

624 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