错误“方法”~“对象“~”的失败”编译时

发布于 2024-10-15 12:10:41 字数 131 浏览 2 评论 0原文

我正在尝试更新一个旧应用程序,该应用程序将 IP 硬编码到数据库连接字符串中,它出现错误“对象“~”的方法“~”失败”我们不确定为什么会收到此错误,我们可以让 VB6 来请给我们更多详细信息,或者我们可以在编译的 EXE 中更改数据库连接的 IP。

I am trying to update a legacy application which has the IP hardcoded into the DB connect string, It errors with "Method "~" of object "~" failed" We are not sure why we are getting this error, can we get VB6 to give us more detail or can we change the IP of a DB connect in an compiled EXE.

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

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

发布评论

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

评论(3

波浪屿的海角声 2024-10-22 12:10:41

看看项目中的“参考文献”是否丢失了?

已经有一段时间了,但我会先检查是否有丢失的参考资料。

更新

这是一个很好的问题。
Vb6 引用首先显示已使用的引用,然后显示所有可用的引用。
可用项目未经过检查,并按字母顺序显示。
如果您缺少参考,它将与所选项目一起分组在列表顶部,但不会被检查。
即,紧随所选引用之后且不按顺序出现的任何未选中的引用都是“丢失”引用。

Look in the projects "References" are any missing?

It's been awhile but I'd check for missing references before anything else.

Update

That's a good question.
Vb6 references show the used references first, then all the ones that are available.
The available items aren't checked and are shown in alphabetical order.
If you have a missing reference, it will be grouped at the top of the list with the selected items, but won't be checked.
i.e. Any unchecked references that come immediately after the selected references, and that aren't in order are the "missing" references.

诠释孤独 2024-10-22 12:10:41

您可能想要尝试的另一项检查是为整个项目设置Option Explicit。这将显示尚未显式声明的变量。

另外,您可能想调查 Object 类型的所有变量:后期绑定可能会带来意想不到的痛苦,我建议尽可能少地使用后期绑定。

然后是COM。如果应用程序已针对不同版本的 COM 组件(例如 OLEDB/ADO MDAC 组件)进行编译和测试,并且现在针对新版本运行,则方法可能已被删除或重命名。

最后,尝试添加更多/更好的错误处理,以便您确切地知道哪一行代码生成错误。

编辑 如果您没有源代码,那么剩下的唯一选择就是查明应用程序已针对哪些版本的 MDAC/数据库组件进行了测试。

Another check you might want to give a go is setting Option Explicit on for the entire project. This will show you the variables that have not been explicitly declared.

Also you might want to investigate all variables of type Object: Late Binding can be an unintended pain and I suggest to have as little Late Binding as possible.

Then there is COM. If the application has been compiled and tested against a different version of a COM component such as the OLEDB/ADO MDAC components and now is running against new versions, methods might have been removed or renamed.

Finally, try to add more/better error handling so you know exactly what line of code generates the error.

EDIT If you do not have the source code, the only option left is to findout against what versions of MDAC/Database components the application has been tested.

魂牵梦绕锁你心扉 2024-10-22 12:10:41

它可能涉及 MDAC DLL ,您可以在此处找到此类问题的详细答案问题。

it can concern MDAC DLL , you can found here a detailled answer for this kind of problem.

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