MySQL ODBC 5.1 驱动程序不允许设置名称
我有一个 windows 2008 服务器和一个 asp 网站.
I've a windows 2008 server and an asp website.
我将站点从 Windows 2003 服务器移至我的服务器,它运行良好.它使用 mysql 作为数据库,Set Names 'Latin5' 是 odbc 驱动程序的初始语句.
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.
我尝试设置相同的初始语句,但收到驱动程序不允许设置名称"错误消息,并且 db update/insert 查询出错.
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.
该网站使用土耳其语.
感谢您的帮助..
推荐答案
SET NAMES 已在 MyODBC 版本 5.1 中删除.http://dev.mysql.com/doc/refman/5.1/en/connector-odbc-news-5-1-1.html
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
所以你有几个选择:
使用 MyODBC 5.1,删除所有 SET NAMES 调用.
With MyODBC 5.1, remove all of the SET NAMES calls.
在 ODBC 中更改您的 DSN 以指定字符集,否则如果您使用的是无 DSN 连接字符串,则需要添加 Charset=Latin5;
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;
示例:
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword; Charset=Latin5;
您可能还需要分隔表名,MySQL 使用 ` 来分隔表名.
You may also need to delimit your table names, MySQL uses ` to delimit table names.
示例:
SELECT id FROM `table`;
最后一个选择是降级到 MyODBC 3.51.
Last option is to downgrade to MyODBC 3.51.
相关文章