修复访问VBA 2010中的错误429 [英] Fix an error 429 in access VBA 2010

查看:72
本文介绍了修复访问VBA 2010中的错误429的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

晚上好,世界!!我正在使用旧的Access 2010应用程序,我收到错误消息429Activex无法创建对象。



对库的引用是正确注册在项目的引用列表中,文件(.TLB文件)现在已在Windows 7中正确注册。我认为这样做足以解决问题,但它仍然保持不变;这就是为什么我诉诸这个论坛(我希望这样说是正确的)。



我曾经在VB 6上工作很多,发现这个问题很多时间,但解决它从来没有这么困难。我不得不承认我缺乏访问经验。



dll是供应商最近提供给我们的一个,我不知道它是在相同版本的Access中开发还是什么,所以它可能是一个兼容性问题。我的问题是我的老板不想再与这个供应商打交道了,他们不得不采取法律行动来获得这个最终组件,所以我必须解决这个问题。



这是一段代码:



  Dim  objProd  as   new  ProductoTemporal(  ProductoTemporal    class 包含 in 已注册的DLL)
Dim Cadena as < span class =code-keyword> string





昏暗之后,如果我把光标放在上面 objProd 它显示



引用:

对象变量或语句宽度未建立; Cadena有一个值





当代码尝试为一个属性赋值(Conexion)时:



 objProd.Conexion = Cadena( string 变量已经有正确的 string  connecction)





这是程序失败的时候。



我真的很感谢任何人的帮助。



我的尝试:



我甚至试图改变代码,但它花了我很多时间。

解决方案

看看这里: ActiveX组件无法创建对象或返回对此对象的引用(错误429 ) [ ^ ]

在那里你会找到最常见的原因以上错误。







在开始更改任何内容之前,请阅读:

如何在Word中的Visual Basic编辑器中检查和删除不正确的项目引用 [ ^ ] - 这个主题与MS有关并不重要Word,VBA编辑器是相同的

检查或添加对象库参考 [ ^ ]





尝试更改你的代码进入下面的表单,找出发生的事情。

 ' 这应该在模块的开始时声明 
选项 明确

' 你的soubroutine
Sub CheckMyObject

Dim objProd as ProductoTemporal

开启 错误 转到 Err_CheckMyObject

设置 objProd = ProductTemporal

MsgBox 对象'ProductTemporal'已成功创建!,vbOkOnly, 成功!

Exit_CheckMyObject:
On 错误 恢复 下一步
设置 objProd =
退出 Sub

Err_CheckMyObject:
MsgBox Err.Description,vbExclamation,Err.Number
Resume Exit_CheckMyObject

退出 Sub


Good evening, World !!. I'm working with an old Access 2010 application, and I'm getting an error message 429 "Activex cannot create the object".

The reference to the library is correctly registered in the references list of the project, and the file (a .TLB file) is now properly registered in windows 7. I thought doing that was enough to solve ths problem, but it still remains the same; that´s why I resort this forum (I hope is correct to say so).

I used to work a lot with VB 6 and found this problem a lot of time, but it was never this difficult to me to solve it. I have to admit my lack of experience with access.

The dll is one that a vendor gave us recently, I don´t know if it's developed in the same version of Access or what, so it could be a compatibility issue. My problem is that my bosses don´t want to deal with this vendor anymore, they had to take a legal action even to get this final component, so I have to solve this.

Here's a piece of code:

Dim objProd as new ProductoTemporal ("ProductoTemporal" is a class contained in a registered DLL)
Dim Cadena as string



After the dim´s, if I put the cursor above "objProd" it shows

Quote:

"Object variable or statement width not stablished"; "Cadena" has a value ""



When the code tryes to assign a value to one property (Conexion):

objProd.Conexion = Cadena  (The string variable already have the proper string connecction)



here´s when the program fails.

I would really appreciate anyone's help.

What I have tried:

I'm even trying to change the code, but it has take me a lot of time.

解决方案

Take a look here: ActiveX component can't create object or return reference to this object (Error 429)[^]
There you'll find the most common reasons of above error.


[EDIT]
Before you start changing anything, please, read this:
How to check and remove incorrect project references in the Visual Basic Editor in Word[^] - it's not important that this topic concerns MS Word, VBA editor is the same
Check or Add an Object Library Reference[^]


Try to change your code into below form to find out what happend.

'this should be declared on the beggining of module
Option Explicit

'your soubroutine
Sub CheckMyObject

Dim objProd as ProductoTemporal

On Error Goto Err_CheckMyObject

Set objProd = New ProductTemporal

MsgBox "Object 'ProductTemporal' has been successfully created!", vbOkOnly, "Success!"

Exit_CheckMyObject:
    On Error Resume Next
    Set objProd = Nothing
    Exit Sub

Err_CheckMyObject:
    MsgBox Err.Description, vbExclamation, Err.Number
    Resume Exit_CheckMyObject

Exit Sub


这篇关于修复访问VBA 2010中的错误429的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆