Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automation Error -2147417848

Status
Not open for further replies.

TooMuchCoffee

Programmer
Feb 7, 2003
13
US
Looked on the web for MANY days for any help on this but everyone suggests something else and so far none of it has helped. Ugh. Maybe this site will be better since there is a large "brain trust" :) here.

Ok, I've taken over a VB6 SP5 application that connects to an Access 2000 DB (ver 9.0.3821 SR-1)

While executing the program in VB6 it works perfectly. When I create the *.exe and distribute and install to the SAME computer I developed it on (and other PCs in the office), I encounter the "Automation Error -2147417848 The object invoked has disconnected from it's clients". What's weird is that it happens even on the machine I develope on.

There are some Crystal Reports 8.0.1.0 (CRW32 8.0.0.441) reports and viewers integrated into the system as well as APEX True DBGrid Pro 6.0 (build 6.0.0204 ) controls. My data controls are the objects that come with VB...I'm using the MS DAO 3.6 Object Library, I have the latest MDAC (even copied to the redistribute directory of VB) yadda yadda yadda. I've tried installing MDAC then JET 4 SP3 on the machine still, same problem. Can anyone think of what is causing this? I've even run the application that compares DLLs in memory between machine X and machine Y - they are identical.

If you'd like a code snippet, let me know.

Thanks for your help
At Wits End,
Aaron
 
Ok, what are you doing right before this happens, also in the ActiveX Component that you are making this call what is the program trying to do. If you can post some code. Thanx
 
rorubin:
code of program when it bombs - unfortantly when it bombs out (only when it's in *.EXE format) I can't go into BREAK mode and see the exact highlighted error-generating code. I've marked the position with an "===>" where the code begins to execute (strFilterMode = "BUILDFILTER") the error. cmbShipMethod is a combo box. I know that it bombs out whenever it set's the .text value to "NONE" - determined that because I'll get the msgbox up to "TEST 3" then it dies.

Private Sub cmdFindRecord_Click()
On Error GoTo err_Handle
Me.MousePointer = vbHourglass

Select Case strFilterMode
Case "BUILDFILTER"
Dim mySQL As String
Dim i As Integer
Dim rs As DAO.Recordset
Dim numRecords As Integer

'Enable all controls
Call unLockInitControls

'Keep the manifest locked
Me.fraManifest.Enabled = False
Me.txtItem.Enabled = False
Me.txtItem.Locked = True
Me.txtItem.BackColor = vbButtonFace
Me.txtQuantity.Enabled = False
Me.txtQuantity.Locked = True
Me.txtQuantity.BackColor = vbButtonFace
With tdbgShippingLogDetail
.AllowAddNew = False
.AllowDelete = False
.AllowUpdate = False
.BackColor = vbButtonFace
End With
Me.cmdAddItem.Enabled = False
Me.cmdDeleteItem.Enabled = False

'Clear the form of all values
MsgBox "TEST 1"
flgFirstActivate = True
MsgBox "TEST 2"
Me.cmbCarrier = 15
MsgBox "TEST 3"
===> Me.cmbShipMethod.Text = "None"
MsgBox "TEST 4"
..... more code but removed ...

Here is how I get values into the cmbShipMethod combo box:
Public Sub LoadFormComboBoxes()

Dim mySQL As String
Dim i As Integer
Dim rs As DAO.Recordset

With frmShipping
'Setup Shipping Log combo box data
mySQL = &quot;...<removed SQL string to keep this short>&quot;

Set rs = dbSSC.OpenRecordset(mySQL, dbOpenForwardOnly)
InitialRecordID = rs!pkid
i = 0
.cmbShipRecord.ColumnCount = 6
.cmbShipRecord.ColumnWidths = &quot;30;70;55;75;150;150&quot;
.cmbShipRecord.TextColumn = 1
.cmbShipRecord.ListWidth = 540
Do Until rs.EOF = True
.cmbShipRecord.AddItem
.cmbShipRecord.List(i, 0) = rs!pkid
.cmbShipRecord.List(i, 1) = IIf(IsNull(rs!appliestoPO), &quot;&quot;, rs!appliestoPO)
.cmbShipRecord.List(i, 2) = rs.Fields(&quot;ShipDate&quot;).Value
.cmbShipRecord.List(i, 3) = rs.Fields(&quot;Carrier&quot;).Value
.cmbShipRecord.List(i, 4) = rs.Fields(&quot;Custname&quot;).Value
.cmbShipRecord.List(i, 5) = rs.Fields(&quot;Contact&quot;).Value
rs.MoveNext
i = i + 1
Loop
 
Ok, I just changed:
Me.cmbShipMethod.Text = &quot;None&quot;
to
Me.cmbShipMethod = &quot;&quot;

recompiled and executed the *.exe file. That particular error is gone. I really don't understand it, though.

I also get this &quot;Automation Error&quot; when I export a CR report to MS word - as an RTF document.

It seems that this error message is rather vague and confusing.
 
It has to do with missing, corrupted, or not registered dll, ocx, or even exe (ActiveX) files, and there associated dependencies.
 
Do you know how I would go about finding what files are &quot;missing, corrupted, or not registered dll, ocx, or even exe (ActiveX) files, and there associated dependencies&quot;? Thanks for your help/suggestions/ideas.
 
Ok. Take a look at the &quot;point&quot; where you get the automation error. At that point what object are you trying to create? Or what is the method that you are trying to call in that Object. Additional a good way to debug a program is to use a function called Erl.

Erl works like this.

On error goto myError

1 VB Code Line 1
2 VB Code Line 2
3 Vb Code Line 3
4 VB Code Line 4
(etc. Don't use duplicate numbers.)

myError:
if err <> 0 then
MsgBox &quot;Error Reported : &quot; & err & err.description & _
ctr(erl)
end if

Try to see if you can find the object that is causing the error if you can't try erl it will pinpoint the error for you. good luck, and let me know how it goes.
 
Thanks for your help. I've never heard of Erl before. I'll give it a shot and see what I can find. You've been most helpful!
 
could you figure it out what was the error.

i am also getting the same error.

please reply
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top