Solved

Run time error '429

Posted on 2001-06-11
16
731 Views
Last Modified: 2012-06-27
Using VB6.  I've designed a small program for use within our office, but run into the error listed in the question.  The error goes on to say:  Active X component can't create object.

The program is designed to capture data, and use a query in Access, from which a report is generated.  Once the report is generated, the program deletes the "just input" data, to avoid printing lots of report pages.  Instead it stores the data in another table not used by the report.

The program works fine in the design environment.  When I have loaded data on the forms, updated the temporary database and permanent database, then click print, I get the error.

Any idea what's causing this?

JB
0
Comment
Question by:DrJax
  • 4
  • 4
  • 2
  • +5
16 Comments
 
LVL 3

Expert Comment

by:Maxim10553
Comment Utility
You need to make sure that all ActiveX components you are using in the program are installed/registered correctly, you get this error message when VB cant find/use the dll, exe, or ocx.
0
 
LVL 1

Expert Comment

by:ShaneCourtrille
Comment Utility
ActiveX Component Can't Create Object is the error that occurs when a component that your program needs to create can't be created.  I would step through the code and figure out exactly which component it blows up on.  

By works fine in the design environment you mean it works great on your machine but on any one elses machien it breaks? In this case the problem is you're not distributing the components your program needs.  For instance if you're using ADO it must be installed on the machine... etc...
0
 
LVL 4

Expert Comment

by:vindevogel
Comment Utility
both comments above are right ....
best solution is to create a setup package using the package & deployment wizard.
running that setup.exe on the client, will install all dll's and register them.
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
>>then click print, I get the error

Access reports? In this case, you need to install Access on this other PC to be able to use Access reports.
0
 

Author Comment

by:DrJax
Comment Utility
emoreau,

What you're saying makes sense.  The two machines I attempted to install the program on don't have MSAccess.  They're used primarily for medical billing.  Is there an alternative?  I'm sure Microsoft doesn't want me deploying Access.

JB
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
Alternative are almost any other report engine like Crystal Report, Active Report and many many others.
0
 
LVL 9

Expert Comment

by:Valliappan AN
Comment Utility
You could use Rich Text box control to display the report with rtf file format or can also print to Word document, here, you may not need to deploy anything.
0
 

Expert Comment

by:gauravdhup
Comment Utility

This code is for hiding in win 98


Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
Private Const RSP_SIMPLE_SERVICE = 1
Private Const RSP_UNREGISTER_SERVICE = 0


Public Sub HideApp()

Dim process As Long
process = GetCurrentProcessId()
Call RegisterServiceProcess(process, RSP_SIMPLE_SERVICE)

End Sub
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Expert Comment

by:gauravdhup
Comment Utility
The class isn't registered. For example, the system registry has no mention of the class, or the class is mentioned, but specifies either a file of the wrong type or a file that can't be found.
If possible, try to start the object's application. If the registry information is out of date or wrong, the application should check the registry and correct the information. If starting the application doesn't fix the problem, rerun the application's setup program.

A DLL required by the object can't be used, either because it can't be found, or it was found but was corrupted.
Make sure all associated DLLs are available. For example, the Data Access Object (DAO) requires supporting DLLs that vary among platforms. You may have to rerun the setup program for such an object if that is what is causing this error.

The above is the text from MSDN
Since you are getting an error when you press the print button

I suppose you are using commondialog box for prininting
if this is the case then register the comdlg32.ocx by dragging and dropping it on regsvr32.exe file which is present in the windows registry

The code for printing using common dialog box is as follows

Private Sub mnuFilePrint_Click()
    On Error Resume Next
    If ActiveForm Is Nothing Then Exit Sub
   
    With ActiveForm.CommonDialog1
        .DialogTitle = "Print"
        .CancelError = True
        .Flags = cdlPDReturnDC + cdlPDNoPageNums
        If ActiveForm.Text1.SelLength = 0 Then
            .Flags = .Flags + cdlPDAllPages
        Else
            .Flags = .Flags + cdlPDSelection
        End If
        .ShowPrinter
        If Err <> CommonDialog1.cdlCancel Then
            ActiveForm.Text1.SelPrint .hDC
        End If
    End With

End Sub
0
 

Expert Comment

by:VBSysCOM1
Comment Utility
Ok create a form add it to startup in project properties next I register all of my Ocx files this way. Make The
Startup form

Visible = False
Minimized = True


Private Sub Form_Load() 'Startup Form
On Error GoTo err75 ' If File Exisist In The System Folder
Dim Ocx As String 'The Active X File That You Want To Register

Dim Mapped As String 'The Server Drive Where The OCX Is
Dim System As String 'Windows System Folder
Dim Reg As String 'Register The OCX
Dim UnReg As String 'UnRegister The OCX
Dim Start As form2 'The Form That Is Given You The Problem
Reg = "C:\Windows\System\regsvr32.exe  /s" 'Path To Regsvr32

UnReg = "C:\Windows\System\regsvr32.exe /u /s " 'Path To Regsvr32
 
Mapped = "F:\OCX\" 'The Drive Path To The Active X File
System = "C:\Windows\System\" 'Windows System Path
Ocx = "Sample.ocx" 'Active X File Name

FileCopy Mapped & Ocx, System & Ocx
Shell Reg & System & Ocx

err75: ' If Error Number 75 Occurs  Do The Events
If Err.Number = 75 Then
Err.Clear
Shell UnReg & System & Ocx ' Unregister The File
Kill System & Ocx 'Delete The File
FileCopy Mapped & Ocx, System & Ocx 'Re Copy The File
Shell Reg & System & Ocx "Re Register The File
Start.Show 'The Form That Contains The Active X File
UnLoad Form1
End If
Start.Show 'The Form That Contains The Active X File
Unload Form1
End Sub


Note That this is nice for when you want to update your Activex File Without The User Knowing It.

-Have A Good Day
0
 

Expert Comment

by:VBSysCOM1
Comment Utility
Sorry Should Have Tested This Before I Posted It This Will Generate An Error 91 Need To Remove 2 Lines Of Code.


Private Sub Form_Load() 'Startup Form
On Error GoTo err75 ' If File Exisist In The System Folder
Dim Ocx As String 'The Active X File That You Want To Register

Dim Mapped As String 'The Server Drive Where The OCX Is
Dim System As String 'Windows System Folder
Dim Reg As String 'Register The OCX
Dim UnReg As String 'UnRegister The OCX
Dim Start As form2 'The Form That Is Given You The Problem
Reg = "C:\Windows\System\regsvr32.exe  /s" 'Path To Regsvr32

UnReg = "C:\Windows\System\regsvr32.exe /u /s " 'Path To Regsvr32

Mapped = "F:\OCX\" 'The Drive Path To The Active X File
System = "C:\Windows\System\" 'Windows System Path
Ocx = "Sample.ocx" 'Active X File Name

FileCopy Mapped & Ocx, System & Ocx
Shell Reg & System & Ocx

err75: ' If Error Number 75 Occurs  Do The Events
If Err.Number = 75 Then
Err.Clear
Shell UnReg & System & Ocx ' Unregister The File
Kill System & Ocx 'Delete The File
FileCopy Mapped & Ocx, System & Ocx 'Re Copy The File
Shell Reg & System & Ocx "Re Register The File
Start.Show 'The Form That Contains The Active X File
UnLoad Form1
End If
' Remove Start.Show 'The Form That Contains The Active X File
' Remove Unload Form1
End Sub
0
 

Author Comment

by:DrJax
Comment Utility
VBsysCOM1 (Kevin),

You're over my head on this one.  Are you saying that the code you've provided will allow me to print a MSAccess report even when Access is not loaded on the machine? Or, are you suggesting an alternative report option?  I think the error code I'm getting is telling me that it can't create the report because Access is missing.... Please help if you can.  Thanks.

JB
0
 

Expert Comment

by:VBSysCOM1
Comment Utility
Well JB you are telling me that you receive Run-Time Error '429' which is generated when a Active X object is not registered.
My next question to you is?
1.) When you run this application from your machine note
    That you programmed this Application do you get this
    Error.
2.) If you do not get this error when running the app
    from your machine and the end users do. The problem
    Is not the Application it is the enduser do not have
    the proper files installed on there computer.
3.) Note if this is the case then you need to either run
    The code that I gave you through your app or created
    a setup file use VB6's Package & Deployment Wizard and
    install the application on each one of the users pc's

Note please provide me with more information on what you are trying to do and the exact error so I can futher assist you on your problem.

Have A Good Day
0
 

Author Comment

by:DrJax
Comment Utility
Kevin,
I'll send you the entire (small) program if you like.  That way you can see what I have and maybe better understand what I'm trying to do.  Where should I send it???

JB
0
 

Accepted Solution

by:
VBSysCOM1 earned 85 total points
Comment Utility
JB

you can send it to kevin@financialdimensions.com. I will look it over and fix it for you ok.



Thank You And Have Good Day!
0
 

Author Comment

by:DrJax
Comment Utility
The BEST assistance I've received since using EE.  Super guy who knows his stuff!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now