List:MySQL ODBC« Previous MessageNext Message »
From:Jay Miller Date:March 18 1999 2:43pm
Subject:RE: Access <-> MyODBC <-> MySQL problem
View as plain text  
> Struan> I've designed an Access Query such that the Access 'SQL
> View' says:
>
> Struan> SELECT RawM.Name, * FROM RawM WHERE (((RawM.Name) Like
> 'MYINFOBOX%'));
> > Struan> Umm?! Can anyone tell me how/why the SQL "Like" (in the
> original SQL
> Struan> statement) been changed to an "="? And by what? Or should
> I post this
> Struan> query to the MyODBC list?
> Struan> However, the appropriate excerpt from the MyODBC log file says:
>
> Struan> MSACCESS        de:aa	ENTER SQLExecDirect
> Struan> 		HSTMT               0x008b24f0
> Struan> 		UCHAR *             0x086513d4 [      -3]
> "SELECT RawM.ID FROM RawM WHERE (Name = 'MYINFOBOX%' ) "
> Struan> 		SDWORD                    -3

I believe that the reason Access is translating the query is because it
doesn't see any wildcards in your comparison string.  Access uses '*' rather
than '%' as a wildcard.  Since it doesn't see any wildcards in your query,
it changes it to the faster '=' comparison.  Two options to resolve it:

1) If you change your query to a Pass-Through query (Query | SQL Specific |
Pass-Through) it won't translate.
2) If you change your wildcard character to '*', Access will see it as a
wildcard and pass it to mysql as '%'.

Jay Miller
Socket Internet Services
Columbia, MO, US

Thread
RE: Access <-> MyODBC <-> MySQL problemJay Miller18 Mar