有没有办法让VBA将中文文本值传递给SQL服务器表。 [英] Is there a way for VBA to pass Chinese text values to SQL server tables.

查看:69
本文介绍了有没有办法让VBA将中文文本值传递给SQL服务器表。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用SQL 2014后端继承了Access 2010数据库。  许多主键和外键都是TEXT字段。我不会这样做,但它达到了一定程度。那一点是我们需要在这些
字段中输入中文字符。

I have inherited an Access 2010 database with SQL 2014 back end.  Many of the Primary and Foreign Keys are TEXT fields. I wouldn't have done it this way, but it worked up to a point. That point is when we needed to enter Chinese characters in these fields.

VBA程序和函数无法识别Unicode中文字符,并将字符串翻译为"????"。这使得无法将值传递给SQL服务器以及在这些字段填充用于
选择条件的组合框时创建问题。 

The VBA procedures and functions do not recognize Unicode Chinese characters and translates the strings as "????" This makes it impossible to pass the value to SQL server as well as creating issues when these fields populate combo boxes used to select criteria. 

我们考虑添加新的数字SQL表的主键和外键,但我们需要在VBA模块,查询,视图和存储过程中进行的更改次数需要花费相当长的时间才能完成。

We looked at adding new Numeric Primary and Foreign Keys to the SQL tables but the number of changes we would need to make in VBA modules, Queries, Views, and stored procedures would have taken a prohibitively long time to accomplish.

有没有办法围绕Unicode文本包装函数,以便VBA可以将这些值传递给SQL Server?

Is there a way to wrap a function around Unicode text so that VBA can pass these values to SQL Server?

推荐答案

嗨thribben

您可以更改非Unicode程序的语言,以便识别中文。在Windows10操作系统中,您可以转到Control-Pane-> Region-> Adminstrative->非Unicode程序的语言,然后选择中文。以下是示例。

You could change language for non-Unicode programs to make the access to recognize Chinese. In Windows10 OS, you could go to Control Pane->Region->Adminstrative->Language for non-Unicode programs and select Chinese. Here is the example.

这是测试。

最好的问候,

Terry


这篇关于有没有办法让VBA将中文文本值传递给SQL服务器表。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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