[AccessD] SQL "Like" question.

Lonnie Johnson prodevmg at yahoo.com
Fri Jun 24 10:17:00 CDT 2005


Yes, the brackets are reserved for enclosing table, query and field names. You may also want to look out for the tick mark or single quotation mark ('). This can trick your code to thinking you have jumped out of the SQL String. For example the name O'Hare.

Bobby Heid <bheid at appdevgrp.com> wrote:Hey,

I have a search screen for an app that has several combo boxes that when the
user clicks the Find button, it builds a SQL query based upon the criteria
that the users have selected. The user can also use wild cards in the combo
boxes such as 'Carlton*'. Since they can use wild cards, I use LIKE when
building the SQL statement.

I got an email from a user today asking why a given project search was
returning no records. I looked at the data and this is what they were
searching for: 'Carlton [D]'. I suspected the data so I removed the
brackets from around the 'D' and the query worked fine.

My question is, is the bracket a special character? Are there other
characters that I need to watch out for? I know about the wild card
characters '*', '?', and the '#' character.

Thanks,
Bobby

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




May God bless you beyond your imagination!
Lonnie Johnson
ProDev, Professional Development of MS Access Databases
Visit me at ==> http://www.prodev.us





 





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the AccessD mailing list