Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Run time error '429

Posted on 2001-06-11
16
738 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
ID: 6178846
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
ID: 6178854
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
ID: 6179293
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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6179417
>>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
ID: 6179667
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 70

Expert Comment

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

Expert Comment

by:Valliappan AN
ID: 6179813
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
ID: 6181076

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
 

Expert Comment

by:gauravdhup
ID: 6181102
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
ID: 6182400
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
ID: 6182418
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
ID: 6183006
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
ID: 6183085
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
ID: 6188331
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
ID: 6188474
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
ID: 6217900
The BEST assistance I've received since using EE.  Super guy who knows his stuff!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

829 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