Automation错误可以理解为自动化错误,也就是说在你的程序里所用到的组件里的方法等冲突所造成的,我有过一次经验,我在一个工程中添加了truedbgrid6.0和truedbgrid7.0两个组件,当我在窗体上用truedbgrid7.0画了一个网格后,在程序中加入如下代码:
Dim cItem As New TrueDBGrid70.ValueItem
在一般的运行时没有问题,可是经过一些操作后,就会出现Automation错误,并且不是在每台机器上都出,经过分析是citem没有被new出来,最后反复研究,将窗体上的网格换成truedbgrid6.0,代码改成Dim cItem As New TrueDBGrid60.ValueItem,就没有问题了。这说明是TrueDBGrid6和TrueDBGrid7组件冲突造成的原因,不知道你的情况是否和我的类似
Error Messages
The following list describes the more common run-time errors encountered in Automation. The symbol < > represents a parameter that will be inserted into the error message.
Error number Error description
-2147164975 You cannot change the Admin name or access privileges.
-2147166139 Invalid DOS path: < >
-2147166373 File < > is currently checked out by < >.
-2147166374 You currently have file < > checked out.
-2147166386 Cannot delete the root project.
-2147166391 You do not have access rights to < >.
-2147166398 Cannot move the root project.
-2147166404 File < > is not checked out.
-2147166405 File < > is not shared by any other projects.
-2147166411 Cannot Rename the root project.
-2147166417 A project cannot be shared under a descendant.
-2147166418 File < > is already shared by this project.
-2147166424 The SourceSafe database has been locked by the Administrator.
-2147166519 Invalid password.
-2147166521 Cannot delete the Admin user.
-2147166522 Permission denied.
-2147166525 User "< >" already exists.
-2147166526 User "< >" not found.
-2147166572 An item with the name < > already exists.
-2147166574 You can not move a project under itself.
-2147166583 Version not found.
-2147167977 The SourceSafe database path < > does not exist. Please select another database.
-2147210887 This command only works on projects.
-2147210888 This command only works on files.
-2147352566 Invalid access code (bad parameter)*.
*Many SourceSafe parameters have a maximum limit. For example, the name of a SourceSafe user may not exceed 31 characters. When limits such as this are exceeded, the run-time error -2147352566 is typically returned. For detailed information on limits imposed by SourceSafe, please see the Knowledge Base article Q138298, titled "Visual SourceSafe System Capacities and Specifications."