Cant clear Filter property in ADO Recordset
Posted on 2002-03-10
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,