Filter ADO Recordset Error

U

ufgator1978

Hi All,

First off I'd like to mention that I know this should be done in
ADO.NET, but I have been asked to do it in regular ADO. =( Having said
that, here is the problem I am experiencing...

I'm working with VB.NET and I have a recordset and I am trying to set a
filter on it. I am getting an error that says "Arguments are of the
wrong type, are out of acceptable range, or are in conflict with one
another." Here is the code I am using:

Dim rs As ADODB.Recordset
rs = GetRecordset("SELECT * FROM Test", adUseClient, adLockReadOnly,
adOpenStatic, GetMainConn, True)
rs.Filter = "test"

I checked the filter immediately after I get the recordset and I notice
that the filter has a value of 0 {Integer}. I also verified that the
rs has the correct number of records. Can anyone help me with this
error???

Many thanks...
 
A

Armin Zingler

GatorBait said:
Hi,

Thank you for your response. I know that the filter needs an
expression....I was trying to illustrate that it does not matter
what text I set the filter to. I am getting the error because the
filter is of type Integer and I am setting it equal to an expression
(of any value) of type String.

Do you know why this is not working???

I thought the value of the property is Integer, not the data type of the
property. The message you get, is it a runtime exception or a compiler
message? I guess the latter. I'm afraid, I won't have an answer anyway, but
you might turn to an ADO or Framework.Interop group as this question is not
related to the VB.Net language (what I am (hopefully) better in).


Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top