MS Access查询返回汉字-可能损坏表吗? [英] MS Access query returning Chinese characters - possible table corruption?

查看:65
本文介绍了MS Access查询返回汉字-可能损坏表吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将新版本的数据复制并粘贴到了MS Access表中,现在查询中出现了奇怪的字符.本质上,如果我说:

I copied and pasted a new version of the data into my MS Access table and now I'm getting weird characters in my queries. Essentially if I say:

SELECT a, b from table1

一切都很好.如果我改为

everything is fine. If I instead do

SELECT a, b from table1 group by a, b

结果我得到了非常奇怪的角色.刚开始我会倒置L,但是现在我得到了汉字.这很奇怪,因为我数据库中的其他查询都使用该表并获得了所需的输出.似乎只有当我参加小组讨论时,我才有问题.有什么建议?我已经准备好将其推出,但是现在我遇到了这些错误!

I get really weird characters as a result. At first I got upside down L's, but now I'm getting Chinese characters. It's weird because other queries in my database use the table and get the desired output. It seems like it's only when I do a group by that I have the problems. Any suggestions? I was ready to roll it out, but now I'm getting these errors!

推荐答案

如果对备注字段进行分组,通常会遇到此错误.

This is a bug typically met if grouping on a memo field.

根据您的需求,可能有几种解决方法:

There may be several workarounds depending on your needs:

Select 
    a, Left(b, 255) As b
From 
    table1 
Group By 
    a, Left(b, 255)

Select 
    a, Mid(b, 1) As b
From 
    table1 
Group By 
    a, Mid(b, 1)

Select 
    a, First(b) As firstb
From 
    table1 
Group By 
    a

Select 
    a, DLookUp("b","table1","Id = " & [table1]![Id] & "") AS b
From 
    table1 
Group By 
    a, DLookUp("b","table1","Id = " & [table1]![Id] & "")

这篇关于MS Access查询返回汉字-可能损坏表吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆