我的公司有一个在 Progress 数据库上运行的第 3 方应用程序。 我一直在使用 ODBC 连接在他们的数据库之上构建一个应用程序。
Progress 的“怪癖”之一是它不支持 SQL 列宽度,因此它允许在定义为 varchar(50) 的列中包含 100 个字符。 当通过 ODBC 读取此数据时,出现以下错误:
表中的列 test_column
PUB.test_table 的价值超过其
最大长度或精度。
构建应用程序的公司的支持技术人员建议我在 ODBC 连接的注册表中添加一些围绕标志的解决方案,但是,我找不到任何有关这些标志的用途或可能值的文档。 注册表项是
KEY_CURRENT_USER->软件->ODBC->ODBC.INI->MyODBCConnectionName->解决方法
KEY_CURRENT_USER->软件->ODBC->ODBC.INI->MyODBCConnectionName->WorkArounds2
Google 发现了人们通过添加具有特定值的这些标志来解决的其他问题(包括我个人最喜欢的 The Daily WTF),但我找不到任何地方可以告诉我这些标志实际上是做什么的。 你知道吗?
My company has a 3rd party application that runs on a Progress database. I've been building an application on top of their database using an ODBC connection.
One of the "quirks" of Progress is that it doesn't honor SQL column widths, so it will allow 100 characters in a column defined as a varchar(50). When reading this data via ODBC, I get the following error:
Column test_column in table
PUB.test_table has value exceeding its
max length or precision.
The support techs at the company that build the application pointed me towards adding some work around flags in the registry for the ODBC connection, however, I can't find any documentation as to what these flags will do or what the possible values are. The registry keys are
KEY_CURRENT_USER->Software->ODBC->ODBC.INI->MyODBCConnectionName->WorkArounds
KEY_CURRENT_USER->Software->ODBC->ODBC.INI->MyODBCConnectionName->WorkArounds2
Google has found me other problems that people have solved by adding these flags with specific values (including my personal favourite from The Daily WTF) but I can't find anywhere that tells me what the flags actually do. Do you know?
发布评论
评论(3)
来自 @tom-bascom 的链接不再有效,因为 Progress 移动了他们的知识库。
@stefan-moser 对@mdb 问题的评论是适当的。
根据 第 11 章解决方法选项 ="http://www.datadirect.com/download/docs/odbc/allodbc/help.htm" rel="nofollow">DataDirect Connect 系列 ODBC 参考
WorkArounds2=8192。 启用此选项会导致 Microsoft Access 不传递错误 -7748。 Microsoft Access 仅请求两字节 SQL_C_WCHAR 形式的数据,该缓冲区大小不足以存储 UCS2 字符和空终止符; 因此,驱动程序返回警告“01004 数据被截断”并向 Microsoft Access 返回空字符。 Microsoft Access 然后会传递错误 -7748。
参考资料:
The link from @tom-bascom no longer works because Progress moved their KB.
the comment from @stefan-moser on @mdb's question is appropriate.
According to Chapter 11 WorkAround Options of the DataDirect Connect Series for ODBC Reference
WorkArounds2=8192. Enabling this option causes Microsoft Access not to pass the error -7748. Microsoft Access only asks for data as a two-byte SQL_C_WCHAR, which is an insufficient buffer size to store the UCS2 character and the null terminator; thus, the driver returns a warning, "01004 Data truncated" and returns a null character to Microsoft Access. Microsoft Access then passes error -7748.
references:
它修复了以下问题:
“当使用 Connect for ODBC 驱动程序链接到具有一个或多个与之关联的索引的表时,Microsoft Access 2000 会出现此错误。”
DataDirect 支持知识库
It is a fix for:
'This error occurs with Microsoft Access 2000 when using the Connect for ODBC drivers to link to a table which has one or more indexes associated with it.'
DataDirect Support KB
DataDirect Connect for ODBC 的自述文件(Unix-基于 ODBC 驱动程序)在文档的“驱动程序解决方法选项”部分中包含解决方法列表。
The README file for DataDirect Connect for ODBC (a Unix-based ODBC driver) contains a list of workarounds in the "Driver WorkAround Options" section of the document.