List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:March 18 1999 1:19pm
Subject:Access <-> MyODBC <-> MySQL problem
View as plain text  
>>>>> "Struan" == Struan Bartlett <struanb@stripped> writes:

Struan> Hi. I've an Access 97 database with MySQL (3.22.16a-gamma-log) tables
Struan> linked via MyODBC 2.50.22.

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> 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

Struan> MSACCESS        de:aa	EXIT  SQLExecDirect  with return code 0 (SQL_SUCCESS)
Struan> 		HSTMT               0x008b24f0
Struan> 		UCHAR *             0x086513d4 [      -3] "SELECT RawM.ID FROM RawM WHERE
> (Name = 'MYINFOBOX%' ) "
Struan> 		SDWORD                    -3

Struan> MSACCESS        de:aa	ENTER SQLFetch 
Struan> 		HSTMT               0x008b24f0

Struan> MSACCESS        de:aa	EXIT  SQLFetch  with return code 100 (SQL_NO_DATA_FOUND)
Struan> 		HSTMT               0x008b24f0

Struan> And here's the appropriate except from the MySQL log:

Struan> 990318 11:01:52    2126 Connect    struanb@stripped on newsnow
Struan>                    2126 Query      SELECT Config, nValue FROM MSysConf
Struan>                    2126 Query      SELECT RawM.ID FROM RawM WHERE (Name =
> 'MYINFOBOX%' ) 
Struan> 990318 11:02:35    2126 Query      SELECT RawM.ID FROM RawM WHERE (Name =
> '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? 

Hi!

In this case it's Access that does the transformation.  You have to
write a note to Microsoft and ask why :(

From the MySQL manual:

-------
In some cases Access may generate illegal SQL queries that
'MySQL' can't understand. You can fix this by selecting
"Query|SQLSpecific|Pass-Through" from the Access menu.

Regards,
Monty

Thread
Access <-> MyODBC <-> MySQL problemStruan Bartlett18 Mar
  • Access <-> MyODBC <-> MySQL problemMichael Widenius18 Mar
  • RE: Access <-> MyODBC <-> MySQL problemRobert J Greene20 Mar