pavarotti26
asked on
Cant clear Filter property in ADO Recordset
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
update your ADO version. you seems to have an old version.
ASKER
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.