bugs >> "the object invoked has disconnected from" using intrinsic gri

by QnJhZCBBc2hmb3J0aA » Wed, 24 Oct 2007 01:17:02 GMT

Hi Jan. Thanks for your help.

What is the source property of the error object?
?err.source = TRPolicy
Please note that TRPolicy is the name of the DLL project currently running
(e.g. the project that contains the code that is not working)

?err.LastDllError
0

Check the errors collection of your recordset to eliminate
that as a possibility.
In this case, the code fails on this line:
grd.Col = 9: grd.Text = NVL(rs.Fields("WR_Rate").Value, "0.00000")
If I hover over the rs object code, I see a value of 0.05, which is correct.
?rs.Fields("WR_Rate").Value
0.05
?cntc.Errors.Count --- cntc is the ado.connection object used to open the rs
object
0


Can you set the text property in the immediate window once
the error occurs?
Now THIS may have given us some useful info. Since the value was .05 I
executed:
grd.txt = "0.05" and did not get an error
I then executed
?NVL(rs.Fields("WR_Rate").Value, "0.00000")
0.05
I then executed
grd.Text = NVL(rs.Fields("WR_Rate").Value, "0.00000")
and got the error!
So, I then thought to save the recordset value to a variable and then set
the grid.text to that variable, as in:
strRowData = NVL(rs.Fields("WR_Rate").Value, "0.00000")
grd.Text = strrowdata

and it worked! So although it appears I may have a workaround, this is still
very strange! Any additional info would be most appreciated. In the
meanwhile I will try to use the workaround above and continue testing

Thanks!
--
Brad Ashforth


"Jan Hyde (VB MVP)" wrote:

> Brad Ashforth < XXXX@XXXXX.COM >'s wild thoughts were
> released on Mon, 22 Oct 2007 13:16:02 -0700 bearing the
> following fruit:
>
> >We have suddently started getting this error. We have the following code
> >snippet:
> >
> > grd.Col = 1: grd.Text = rs.Fields("WR_VesselID").Value
> > grd.Col = 2: grd.Text = Trim(cboVessel.Text)
> > grd.Col = 3: grd.Text =
> >Format(NVL(rs.Fields("WR_SumInsured").Value, 0), "#0.00000")
> > grd.Col = 4: grd.Text = rs.Fields("WR_WarRiskZone").Value
> > grd.Col = 5: grd.Text = NVL(rs.Fields("WR_DateIn").Value, "")
> > grd.Col = 6: grd.Text = NVL(rs.Fields("WR_TimeIn").Value, "")
> > grd.Col = 7: grd.Text = NVL(rs.Fields("WR_DateOut").Value, "")
> > grd.Col = 8: grd.Text = NVL(rs.Fields("WR_TimeIn").Value, "")
> > grd.Col = 9: grd.Text = NVL(rs.Fields("WR_Rate").Value, "0.00000")
> > grd.Col = 10: grd.Text = NVL(rs.Fields("WR_Debit").Value,
> >"0.00000")
> > grd.Col = 11: grd.Text = NVL(rs.Fields("WR_Discount").Value,
> >"0.00000")
> > grd.Col = 12: grd.Text = NVL(rs.Fields("WR_Credit").Value,
> >"0.00000")
> > grd.Col = 13: grd.Text = NVL(rs.Fields("WR_Net").Value, "0.00000")
> > grd.Col = 14: grd.Text = IIf(NVL(rs.Fields("WR_Paid").Value, 0)
> ><> 0, "Yes", "No")
> >
> >Stepping through the code, we will get a few lines in and then it will fail
> >with the msg "the object invoked has disconnected from one of its clients".
> >The rs object uses ADO and on the failed row I can hover over the
> >rs.fields(<colname>).value and it will correctly display what I'd expect to
> >see. Similarlly I can check it's value in the immediate window without error.
> >But it will fail when trying to set grd.text the value. I did an internet
> >search for "the object invoked has disconnected from" and found several posts
> >on the subject, none seem to apply. The form in question DOES use a date/time
> >picker and I had seen a post blaming mscal.ocx and when checked I did find
> >that the mscal.ocx in my Office10 folder WAS newer ... but it made no
> >difference. Please help if you can ... Thank you in advance.
>
> What is the source property of the error object?
>
> Check the errors collection of your recordset to eliminate
> that as a possibility.
>
> Can you set the text property in the immediate window once
> the error occurs?
>
>
> --
> Jan Hyde
>
> https://mvp.support.microsoft.com/profile/Jan.Hyde
>


bugs >> "the object invoked has disconnected from" using intrinsic gri

by Jan Hyde (VB MVP) » Wed, 24 Oct 2007 15:56:11 GMT


Brad Ashforth < XXXX@XXXXX.COM >'s wild thoughts were
released on Tue, 23 Oct 2007 10:17:02 -0700 bearing the
following fruit:


What does NVL do?


https://mvp.support.microsoft.com/profile/Jan.Hyde



bugs >> "the object invoked has disconnected from" using intrinsic gri

by Ralph » Wed, 24 Oct 2007 20:32:16 GMT




<snipped>

MSDN Help:
"Returns a non-null value from two expressions."
...
"Use NVL( ) to remove null values from calculations or operations where null
values are not supported or are not relevant."

Think of it as an IIf that doesn't blow up if an expression is null.




"the object invoked has disconnected from" using intrinsic gri

by Jan Hyde (VB MVP) » Wed, 24 Oct 2007 23:53:15 GMT

"Ralph" < XXXX@XXXXX.COM >'s wild thoughts were
released on Wed, 24 Oct 2007 07:32:16 -0500 bearing the
following fruit:




That's not a function that is available in VB6 is it? So I
guess the question is, has the OP written his own version or
is the OP's code something other than VB




https://mvp.support.microsoft.com/profile/Jan.Hyde


"the object invoked has disconnected from" using intrinsic gri

by Ralph » Thu, 25 Oct 2007 03:38:35 GMT




<snipped>

Yeah, I knew where you were going and was being a bit silly. <g>
It certainly looks like ADO, but the "VB" part is a bit suspicious.

Did you notice this bit?
IIf(NVL(rs.Fields("WR_Paid").Value, 0) <> 0, "Yes", "No")




"the object invoked has disconnected from" using intrinsic gri

by wawang » Thu, 25 Oct 2007 08:49:57 GMT

I'm not aware that VB6 has this function, MSDN also shows Visual Foxpro has
one function named NVL(). According to Brad's original posting, I think he
should be using VB6 code.

Anyway, Brad, if you need to continue working on this, please post your
implementation of NVL(). Thanks.


Regards,
Walter Wang ( XXXX@XXXXX.COM , remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.



Similar Threads

1. "the object invoked has disconnected from" using intrinsic grid ct

We have suddently started getting this error. We have the following code 
snippet:

            grd.Col = 1: grd.Text = rs.Fields("WR_VesselID").Value
            grd.Col = 2: grd.Text = Trim(cboVessel.Text)
            grd.Col = 3: grd.Text = 
Format(NVL(rs.Fields("WR_SumInsured").Value, 0), "#0.00000")
            grd.Col = 4: grd.Text = rs.Fields("WR_WarRiskZone").Value
            grd.Col = 5: grd.Text = NVL(rs.Fields("WR_DateIn").Value, "")
            grd.Col = 6: grd.Text = NVL(rs.Fields("WR_TimeIn").Value, "")
            grd.Col = 7: grd.Text = NVL(rs.Fields("WR_DateOut").Value, "")
            grd.Col = 8: grd.Text = NVL(rs.Fields("WR_TimeIn").Value, "")
            grd.Col = 9: grd.Text = NVL(rs.Fields("WR_Rate").Value, "0.00000")
            grd.Col = 10: grd.Text = NVL(rs.Fields("WR_Debit").Value, 
"0.00000")
            grd.Col = 11: grd.Text = NVL(rs.Fields("WR_Discount").Value, 
"0.00000")
            grd.Col = 12: grd.Text = NVL(rs.Fields("WR_Credit").Value, 
"0.00000")
            grd.Col = 13: grd.Text = NVL(rs.Fields("WR_Net").Value, "0.00000")
            grd.Col = 14: grd.Text = IIf(NVL(rs.Fields("WR_Paid").Value, 0) 
<> 0, "Yes", "No")

Stepping through the code, we will get a few lines in and then it will fail 
with the msg "the object invoked has disconnected from one of its clients". 
The rs object uses ADO and on the failed row I can hover over the 
rs.fields(<colname>).value and it will correctly display what I'd expect to 
see. Similarlly I can check it's value in the immediate window without error. 
But it will fail when trying to set grd.text the value. I did an internet 
search for "the object invoked has disconnected from" and found several posts 
on the subject, none seem to apply. The form in question DOES use a date/time 
picker and I had seen a post blaming mscal.ocx and when checked I did find 
that the mscal.ocx in my Office10 folder WAS newer ... but it made no 
difference.  Please help if you can ... Thank you in advance.
-- 
Brad Ashforth

2. Automation error( object invoked has disconnected from its clients)

3. The object invoked has disconnected from its clients - UltraGrid / VB6

Hi,

I'm using Infragistics UltraGrid. When I try and use its Print function I 
Get this error message:
The object invoked has disconnected from its clients

This only seems too happen when running on a Win2003 Server (fully upto date 
with patches) with Citrix.
If I run on a Win XP then no error is recived.

I have found many articles where this error could happen ie calling the 
crystal reports control, Office Automation etc. I've also seen articles 
where to update MDAC.

I've looked on Infragistics forums although someone has asked about this 
problem no solution was given. Also UltraGrid 2 is no longer support by 
Infragistics :(

Anyone come accross this using this Grid?

Thanks in advance
Darren


4. the object invoked has disconnected...

5. Automation error (object invoked has disconnected from its clients)

HI..

We have a VB 6 application (SP5)... running successfully on XP workstation. 
When I run the same application on Win 2000 server. I get a Automation Error 
message -2147417848 ( The object invoked has disconnected from its clients)

I was able to trace the exact location of this error message. It happens in 
the following code

*******
' Picture3 is a Image control
FillPictureFromDisk LogoFileName, Picture3, 0.4, 0.1, vbBlack


Private Sub FillPictureFromDisk(FileName$, ToPic As Control, ByVal vertloc#, 
ByVal HorLoc#, Colorname As String)

' Passing Image control in the ToPic Control
' Pictemp is a imageknife control

ToPic.Picture = Pictemp.Picture

' I get error message after this assignment


End Sub
******

I tried compiling to P-code and Native-code.But I still get the same error.
I would appreciate if somebody can assist me getting this resolved.


Sameer

6. Automation Error - the object invoked has been disconnected from its - VB Crystal Report

7. Automation error - The object invoked has disconnected from its clients

Hello!

I got the above error message on some of the client machines when try to
create the Access database through code using ADOX.  It create the database
and table just fine except when I tried to create the index for the table
then I got the above message.  I got the message when execute
"tbl.Indexes.Append idx".  Do I miss anything?

Here is the code:

Dim tbl As New Table
Dim idx As New ADOX.Index
Dim cat As New ADOX.Catalog

cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.3.51;Data
Source=c:\MyDb.mdb"
tbl.Name = "MyTable"
tbl.Columns.Append "Column1", adInteger
tbl.Columns.Append "Column2", adInteger
tbl.Columns.Append "Column3", adVarWChar, 50
cat.Tables.Append tbl

idx.Name = "myidx"
idx.Columns.Append "Column1"
idx.Columns.Append "Column2"

tbl.Indexes.Append idx


The machine was running:
Windows 2000
Office 2000 SP-3
MDAC 2.7

I appreciated any help I can get.

Thank you!


8. ERROR: the object invoked has disconnected from its client