VB6编译时出错 [英] VB6 Error While compile
问题描述
我试图更新一个遗留的应用程序,其中的IP硬编码到DB连接字符串,它的错误与方法〜对象〜失败我们不知道为什么我们得到这个错误,我们可以
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.
推荐答案
另一个检查你是否可以在一个编译的EXE中更改一个DB连接的IP。可能想要放弃的是为整个项目设置选项显式
。
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.
此外,您可能需要调查 Object $ c $的所有变量c>:晚绑定可能是一个非预期的疼痛,我建议尽可能少的晚绑定。
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.
然后有COM。如果应用程序已针对不同版本的COM组件(如OLEDB / ADO MDAC组件)进行编译和测试,并且现在针对新版本运行,则可能已删除或重命名了方法。
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 如果没有源代码,剩下的唯一选项是找出应用程序已经过测试的MDAC / Database组件的版本。
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.
这篇关于VB6编译时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!