如何解决“属性值无效”的问题。确保输入的值正确。”?

发布于 2024-08-03 07:04:11 字数 633 浏览 2 评论 0原文

我通过互操作程序集从 .NET 调用 COM 库并收到以下错误:

System.Runtime.InteropServices.COMException(0x80040200): 内部错误 (ADODB.Connection, -2147467259, 属性值无效。确保该值输入正确。)

我有同一外部系统的测试版本和生产版本。当通过 COM 库调用测试系统时,一切正常,但当通过 COM 库调用生产系统时,我收到上述错误。我只需更改连接字符串中的计算机名称即可从测试切换到生产,因此我认为此问题的原因是测试系统和生产系统之间的某些差异,而不是我的程序。

当我没有 COM 库的源代码时,如何解决此错误?

我在谷歌上搜索了错误“-2147467259,属性值无效。请确保输入的值正确。”,但关于此错误的信息很少。消息本身非常清楚,也许除了找出连接的哪些属性设置了错误键入的值之外,没有什么其他的了,但我仍然想知道是否有一些关于该特定错误的东西可以让我解决这没有 COM 库的源代码。

ConnectionProperties 集合用于提供程序特定的设置。我的例子中的提供程序是SQLOLEDB.1。我在哪里可以找到该提供商的可能属性?

I'm calling a COM library from .NET through a interop assembly and getting the following error:

System.Runtime.InteropServices.COMException(0x80040200): Internal error (ADODB.Connection, -2147467259, Property value is invalid. Make sure the value is typed correctly.)

I have a test and a production version of the same external system. When calling the test system through the COM library everything works fine but when calling the production system through the COM library I get the error described above. I only have to change a computer name in a connection string to switch from test to production so I assume that the cause of this problem is some difference between the test and production system, not my program.

How do I troubleshoot this error when I do not have the source code to the COM library?

I've googled the error "-2147467259, Property value is invalid. Make sure the value is typed correctly." but there is little to read about this error. The message itself is pretty clear and perhaps there is nothing more to it than to find out what property of the connection is set with a wrongly typed value, but I still wonder if there is something to learn about that particular error that can make me solve this without the source code of the COM library.

The Properties collection of Connection is used for provider specific settings. The provider in my case is SQLOLEDB.1. Where can I find out the possible properties of this provider?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦明 2024-08-10 07:04:11

我在 Excel 后面的 VBA 中使用 ADO 时收到此错误。
显然,您无法在打开的连接上更改[DefaultDatabase]。

I received this error using ADO in VBA behind Excel.
Apparently you cannot change [DefaultDatabase] on an open connection.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文