Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Problem with filter property + SQL Len() function

Posted on 2003-03-12
2
Medium Priority
?
388 Views
Last Modified: 2008-03-06
Hi all,

I'm using Ado 2.5 with Access DB.
The Recordset is created at run-time so it's not connected to any Ado.Connection.

This is a simple question about Filter property of an ado Recordset. I can't set this filter when i'm writing this :

dim myRec as adodb.Recordset
dim MyLongVar as long
'here instruction to construct and fill the recordset
'******

MyRec.open
MyRec.Filter= "len([" & MyRec.Fields(0).Name & "])>" & MyLongVar

And then I've got the common error message "arguments are in conflict...etc."
Is it simply impossible to use the Len() function with the filter property  ?. if not i'll be sad ...

Thanks.
0
Comment
Question by:HaldriX
2 Comments
 
LVL 2

Accepted Solution

by:
AccessHelpNet earned 300 total points
ID: 8121416
Sad but true, the ADO filter doesn't allow any functions.  It really has pretty limited functionality overall. See the docs :

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdapro03_10.asp?frame=true:


Note that the .Filter doesn't even interpret parentheses logically!  Here is a quote from the above link :

"
There is no precedence between AND and OR. Clauses can be grouped within parentheses. However, you cannot group clauses joined by an OR and then join the group to another clause with an AND, like this:
(LastName = 'Smith' OR LastName = 'Jones') AND FirstName = 'John'
Instead, you would construct this filter as
(LastName = 'Smith' AND FirstName = 'John') OR (LastName = 'Jones' AND FirstName = 'John')
"

best regards,

Dave Kawliche
0
 

Author Comment

by:HaldriX
ID: 8126101
Thanks a lot, now I have to compute all datas in the recordset. Sh....ine !

Thanks Dave.
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

581 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