EOleException (Unspecified Error) when querying an Access table from Delphi using ADO
Posted on 2005-05-15
Setup : Delphi 5 Enterprise with Update Pack 1
Application : Email Address Database using ADO to connect to SQL Server 2000 Tables and MS Access table (2003 version) with Jet 4.0 for offline use
I have an application to keep track of over 800 email addresses. I have reports and filtering setup using ADOQueries and it works perfectly in SQL 2000. It also runs very smoothly using the offline Access tables, except when you try to filter query results on one field.
I have a field named 'Domain' which stores the email domain information. There are only 6 possible values, which would be something like 'mail.com', 'messages.biz', etc. I also have a value called '<None>' that tracks removed addresses. When I filter data in my filter form, I do not want removed addresses to be shown, so I always tag on a (AND Domain <> '<None>') to my filter string to prevent showing those addresses.
My entire string would look like : select * from EMAIL where (......) AND Domain <> '<None>'.
So, this has always worked in SQL, but for Access, if I do anything with this one Domain field, I get an EOleException (Unspecified error) when opening the query. If I make any combination of filters using any of the other 14 fields, the queries work, it's only when I add the Domain field to the string do I get the error. In the database, the field is just a 15 character standard text field and is not a key field. There's nothing special about it.
Any help with this one would be appreciated.