MySQL ODBC 5.1 Set Names not allowed by driver

倖福魔咒の 提交于 2019-12-21 23:19:11

问题


I've a windows 2008 server and an asp website.

I moved site to my server from a windows 2003 server and it was working good. It uses mysql as database and Set Names 'Latin5' was it's odbc driver initial statement.

I tried to set same initial statement and I got "Set Names not allowed by driver" error message and db update/insert queries gives error.

The site is in Turkish language.

Thanks for the help..


回答1:


SET NAMES has been removed in MyODBC version 5.1. http://dev.mysql.com/doc/refman/5.1/en/connector-odbc-news-5-1-1.html

So you have a couple of options:

With MyODBC 5.1, remove all of the SET NAMES calls.

Change your DSN in ODBC to specify a character set, otherwise if you are using a DSN-less connection string, you will need to add Charset=Latin5;

Example:

Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword; Charset=Latin5;

You may also need to delimit your table names, MySQL uses ` to delimit table names.

Example:

SELECT id FROM `table`;

Last option is to downgrade to MyODBC 3.51.



来源:https://stackoverflow.com/questions/6361744/mysql-odbc-5-1-set-names-not-allowed-by-driver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!