473,385 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Can you use ASP ADO "Like" to perform a "Not Like" search?

I've never needed it before but now I do!

Does anyone know if you are able to perform a NOT Like search using Classic
ASP ADO?

i.e. myData.Filter = "Ref NOT LIKE '*1234*'"

by the way this doesn't work!! and neither does myData.Filter = "Ref <> LIKE
'*1234*'"

or myData.Filter = "NOT Ref LIKE '*1234*'"

Regards

Adam

--
Phuture-UK +44 (01202) 518122
Jul 22 '05 #1
2 5555
What kind of database?

Also, don't use the filter method of the recordset. By doing that, you're
bringing back all kinds of data that you have no use for, only to filter it
out after the fact. Instead, handle the filtering in the query itself.

SELECT this, that, theOther FROM yourTable WHERE Ref NOT LIKE '%1234%'
Ray at work

"Adam Short" <ad**@phuture-uk.net> wrote in message
news:Ot**************@TK2MSFTNGP10.phx.gbl...
I've never needed it before but now I do!

Does anyone know if you are able to perform a NOT Like search using Classic ASP ADO?

i.e. myData.Filter = "Ref NOT LIKE '*1234*'"

by the way this doesn't work!! and neither does myData.Filter = "Ref <> LIKE '*1234*'"

or myData.Filter = "NOT Ref LIKE '*1234*'"

Regards

Adam

--
Phuture-UK +44 (01202) 518122

Jul 22 '05 #2
Adam Short wrote:
I've never needed it before but now I do!

Does anyone know if you are able to perform a NOT Like search using
Classic ASP ADO?

i.e. myData.Filter = "Ref NOT LIKE '*1234*'"

by the way this doesn't work!! and neither does myData.Filter = "Ref
<> LIKE '*1234*'"

or myData.Filter = "NOT Ref LIKE '*1234*'"

Regards

Adam

No, the NOT keyword is not allowed in the Filter property. While I echo
Ray's advice to use a WHERE clause in your sql string, I do recognized that
you may need to do multiple filters against the same set of records,
hopefully using a disconnected recordset. In this circumstance, here is a
workaround:

What you can do is use the Clone method to create a new copy of the
recordset, apply the filter to the clone using LIKE, delete the records
resulting from the filter from the clone and remove the filter.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris Hodapp | last post by:
I have seen messages posted about this before, and there is a clear reference to it in the manual, but I have been unable to find a solution. I'm on Slackware 9.1, kernel 2.6.0-test11, using...
0
by: Dirk Försterling | last post by:
Hi all, a few days ago, I upgraded from PostgreSQL 7.2.1 to 7.4, following the instructions in the INSTALL file, including dump and restore. All this worked fine without any error (message). ...
3
by: hazz | last post by:
Is Activator.CreateInstance(t,BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.CreateInstance, null, args, null) appropriate given the following; ...
10
by: Clint | last post by:
Hey all - I'm having a really confusing problem concerning a web service. Right now, I have an application that needs to call a web service that does nothing but return "true" (this will...
4
by: LP | last post by:
Hi, My webservice is currently deployed on WIndows 2000 server and runs pretty fine. I am trying to run my webservice on a Windows 2003 server. My webservice tries to write to a eventlog. The...
7
by: Peter Ritchie | last post by:
I'm writing a Web Service and I would like to add performance counter data for monitoring performance of the Web Service's operations over time and load. The problem is, I get the "Requested...
0
by: swatitalati | last post by:
Hello when i invoke a method of web service i m getting error like Server was unable to process request. --> Requested registry access is not allowed. syntex for invoking method is as below ...
5
by: Zytan | last post by:
I am trying to pass a variable that has been disposed into a function that accepts an object, and I get this exception. What does it mean? Why can't I pass in *anything* into a parameter of type...
2
by: hankypan1 | last post by:
Hi All, I need a tree data structure for my application. It is the non - cyclic simple tree where i can have any number of children node and each child can recursively become a sub tree like a...
2
by: jmike | last post by:
I'm using some legacy code that has a user-defined exception in it. The top level program includes this line from TestRunError import * It also imports several other modules. These other...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.