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

查看:17
本文介绍了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天全站免登陆