Solved

Cant clear Filter property in ADO Recordset

Posted on 2002-03-10
3
1,888 Views
Last Modified: 2012-06-21
Hi,

I encountered a strange thing in my app and hoped somebody could help me out.

I have a single data environment with one connection contianing two record sets. One of these recordsets is bound to a data grid.

Now, in reponse to a search I set the filter of this recordset, like so: rsTable.Filter = "Field = 'value'" Now this works fine, the right subset of records are displayed.

Then, we want to clear the search. I.e. no filter. Here is the problem. I cannot get the filter property to clear. Setting it to the "" results in no records being displayed. I also tried:

rsTable.Filter = vbNull

in hopes of setting it to a null string, i.e. no string as opposed to the empty string. This time the record set did not change, the same set of records continued to be displayed.

What would be the correct way to clear the Filter property in the ADO recordset after it has been set previously?

Many thankx in advance,
Pavarotti26
0
Comment
Question by:pavarotti26
  • 2
3 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 50 total points
ID: 6854931
try
rsTable.Filter = adFilterNone
0
 

Author Comment

by:pavarotti26
ID: 6854969
Hi,

Okay great, thats good.

Stange tho, cos it still wouldn't show any records. Eventually discovered that I must put something in the Sort property, then the grid was populated, otherwise it remained empty?

Any ideas why? Strange if you ask me!

Anycase, thanks for the filter tip.


0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 6854972
update your ADO version. you seems to have an old version.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now