简体   繁体   English

Where子句查询中的MS Access Unicode字符

[英]MS Access Unicode Characters in Where Clause Query

I have a ms access database that contains unicode characters - specifically Chinese characters. 我有一个ms访问数据库,其中包含Unicode字符-特别是汉字。 When searching for data in the db as shown below nothing is returned: 如下所示在db中搜索数据时,不返回任何内容:

Select * From 测试 Where 测试 = '测试';

This problem is fixed in sql server by prefacing the search string with N: 通过使用N开头的搜索字符串来解决此问题在sql服务器中:

Where 测试 = N'测试'

However I am unsure how to resolve the problem in ms access. 但是我不确定如何解决ms访问中的问题。

It is able to deal with the characters when they are column headers ie in the From but any comparision in the Where clause fails. 当字符是列标题时,即在From中,但是在Where子句中的任何比较失败时,它都可以处理这些字符。

Try using FIRST instead of WHERE. 尝试使用FIRST代替WHERE。 Are you trying to query text from a memo field, and grouping? 您是否要在备忘录字段中查询文本并进行分组? you may want to look at the post from Allen Browne about this issue: http://allenbrowne.com/bug-18.html 您可能需要查看艾伦·布朗(Allen Browne)关于此问题的帖子: http : //allenbrowne.com/bug-18.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM