环境:D7+ ODBC5.1 +MYSQL5.0   windowxp查询语句: 
      str--是一个string 的变量,并且有值
      sql:='select * from  a where  name='''+str+'''';
      当我 showmessage(sql)时,显示正常,
       但当我执行的候Query.open; 时报错如下:       You have an error in your SQL syntax:check the manual that corresponds to your
MySQL server version for the right syntax to use near ' from a where a='12'' at line 1'.
    很奇怪我showmessage输出时看是正常,为什么mysql 执行的时候多了一个 '(单引号)?
 
    问题出在那里?如何解决?