Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 754
  • Last Modified:

Run time error '429

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
DrJax
Asked:
DrJax
  • 4
  • 4
  • 2
  • +5
1 Solution
 
Maxim10553Commented:
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
 
ShaneCourtrilleCommented:
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
 
vindevogelCommented:
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
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
Éric MoreauSenior .Net ConsultantCommented:
>>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
 
DrJaxAuthor Commented:
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
 
Éric MoreauSenior .Net ConsultantCommented:
Alternative are almost any other report engine like Crystal Report, Active Report and many many others.
0
 
Valliappan ANSenior Tech ConsultantCommented:
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
 
gauravdhupCommented:

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
 
gauravdhupCommented:
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
 
VBSysCOM1Commented:
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
 
VBSysCOM1Commented:
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
 
DrJaxAuthor Commented:
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
 
VBSysCOM1Commented:
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
 
DrJaxAuthor Commented:
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
 
VBSysCOM1Commented:
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
 
DrJaxAuthor Commented:
The BEST assistance I've received since using EE.  Super guy who knows his stuff!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 4
  • 2
  • +5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now