简体   繁体   English

VB6 ADO 记录集字段名区分大小写取决于 Windows 语言设置

[英]VB6 ADO recordset fieldname case sensitivity depends on Windows language settings

I have an ado recordset connected to an access database.我有一个连接到访问数据库的 ado 记录集。 I have a SELECT * Query.我有一个 SELECT * 查询。 I access the fields as:我访问字段为:

rs!ROMRightMinX

rs!ROMRightMaxX

rs!ROMRightMinY

rs!ROMRightMaxY

When I switch Windows to Hungarian, the nY combination in rs!ROMRightMinY becomes case sensitive.当我将 Windows 切换到匈牙利语时,rs!ROMRightMinY 中的 nY 组合变得区分大小写。 Meaning意义

rs!ROMRightMinY      Displays value

rs!ROMRightMInY      Displays value

rs!ROMRigHTMinY      Displays value

rs!ROMRightMiny      Field not found

rs!ROMRightMiNy      Field not found

rs!ROMRightMiNY      Field not found

The other fields work correctly.其他字段正常工作。 Similarly rs!ROMLeftMinY has the same issue.同样rs!ROMLeftMinY也有同样的问题。 I've renamed the field to rs!ROMRightMiYY and it is no longer case sensitive.我已将该字段重命名为rs!ROMRightMiYY ,它不再区分大小写。

All fields work correctly in other Windows languages.所有字段在其他 Windows 语言中都能正常工作。

Any thoughts?有什么想法吗?

Case-sensitivity in table and field names varies between database systems.表名和字段名的大小写敏感性因数据库系统而异。 The SQL92 spec says unquoted identifiers should be case-insensitive. SQL92 规范说不带引号的标识符应该不区分大小写。 But, quoted identifiers should be case-sensitive.但是,带引号的标识符应该区分大小写。

If you can't control the case of the field names in the underlying record source, change your SELECT query to something like this:如果您无法控制基础记录源中字段名称的大小写,请将 SELECT 查询更改为如下所示:

SELECT ROMRightMinX AS [ROMRightMinX], ROMRightMaxX AS [ROMRightMaxX], 
    ROMRightMinY AS [ROMRightMinY], ROMRightMaxY AS [ROMRightMaxY] ...

(Quoting may vary according to system, I use [] here) (引用可能因系统而异,我这里用的是[])

This way, the underlying column gets a case-insensitive match, but the returned columns are case-sensitive, so they should match your code in all locales.这样,底层列获得不区分大小写的匹配,但返回的列区分大小写,因此它们应该与您在所有语言环境中的代码匹配。

My guess is that it is because NY in Hungarian is a digraph .我的猜测是因为匈牙利语中的NY是一个有向图 It corresponds with the behaviour you are describing.它与您所描述的行为相对应。 Ny , ny and NY are understood as one letter (the palatal nasal [ɲ]). Ny , nyNY被理解为一个字母(腭鼻音 [ɲ])。 NX is not a digraph in Hungarian so this works as you would expect. NX不是匈牙利语中的有向图,因此它按您的预期工作。

Just for fun, try it with other Hungarian digraphs: cs , zs , gy , ly , ny , ty , dz , sz , and with the trigraph dzs .只是为了好玩,尝试使用其他匈牙利有向图: cszsgylynytydzszdzs字母dzs

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

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