Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Method of '~' object '~' failed

28 views
Skip to first unread message

Amit Bahree

unread,
Jan 4, 1999, 3:00:00 AM1/4/99
to Ronald Allan A. Lintag
Hi,
I get this whenever I try to create an instance of say an object in a
dll. That is becuase I have the incorrect version of the dll.

Is the project file checked out 2 u or someone else?

Ami.

"Ronald Allan A. Lintag" wrote:
>
> Hi there,
>
> I am just wondering whether Microsoft's VB Development Team can provide
> a more informative error message than "Method of '~' object '~' failed". I
> get
> this error message everytime I try to add a new data environment to a
> project
> whose project file (*.vbp) hasn't been checked out of Visual SourceSafe
> first.
>
> Thanks,
>
> Ronald Allan A. Lintag
> Systems Development Group Head
> Meco Enterprises, Inc.
> Manila, Philippines
>
> P.S.
>
> I am running on an NT4 SP3 and VS6.

Amit Bahree

unread,
Jan 4, 1999, 3:00:00 AM1/4/99
to Ronald Allan A. Lintag
Hi,
I get this whenever I try to create an instance of say an object in a
dll. That is becuase I have the incorrect version of the dll.

Is the project file checked out 2 u or someone else?

Amit.

Ronald Allan A. Lintag

unread,
Jan 5, 1999, 3:00:00 AM1/5/99
to

danie...@my-dejanews.com

unread,
Jan 5, 1999, 3:00:00 AM1/5/99
to
In article <e7XO0QBO#GA....@uppssnewspub05.moswest.msn.net>,

"Ronald Allan A. Lintag" <allan_...@easy.net.ph> wrote:
> Hi there,
>
> I am just wondering whether Microsoft's VB Development Team can provide
> a more informative error message than "Method of '~' object '~' failed". I
> get
> this error message everytime I try to add a new data environment to a
> project
> whose project file (*.vbp) hasn't been checked out of Visual SourceSafe
> first.

Ronald,

This is an ADO bug. There is an error happening somewhere down in your data
environment, but ADO is destroying any useful error information, such as the
Description and Source properties of the Err object, so you can't tell what
the problem is until you alter the error handling in the data environment.
As far as I know (and I just checked last week), Microsoft has yet to
publicly acknowledge this very serious problem with ADO. The explanation is
somewhat lengthy, but if you search for another post in this same group by me
with "ADO Bug" in the subject you'll find more information. Also, I've
posted some stuff about it in microsoft.public.ado.

HTH,
Dan Read
Atlanta, GA

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

esmi...@my-dejanews.com

unread,
Feb 1, 1999, 3:00:00 AM2/1/99
to
Actually, this not not limited to ADO. After I installed MSDN January 99
edition, my Oracle Data Control would generate this error when setting an
oradynaset to it.

In article <76td6a$9mk$1...@nnrp1.dejanews.com>,

Jan Tore Lamoey

unread,
Feb 14, 1999, 3:00:00 AM2/14/99
to
ADO ins't the problem here, thats also my guess.
I have also experienced this with components placed within MTS. The error
appears when there are components that are having trouble with the binary
compatibility (even though VB compiled the components without complaining
about the compatibility).
The solution there was to replace the components with one compiled without
binary compatibility, but this is not an option here.

Jan Tore

<esmi...@my-dejanews.com> wrote in message
news:795ef0$p5v$1...@nnrp1.dejanews.com...

Jay Andrew Allen

unread,
Feb 15, 1999, 3:00:00 AM2/15/99
to
For the record, I produced this problem in VB6 through the following steps:

* Create a Data Environment and define two commands on the Northwind DB: A
Suppliers command that reads the Suppliers table, and a Products command that
restricts its output to a supplied Supplier ID.
* Create a DataCombo and bind the Suppliers commands to its RowMember. Set
ListField to CompanyName, and BoundColumn to SupplierID.
* Create a DataGrid.
* Set the DataCombo's Change event so that, when a new supplier is selected,
the following executes:

if NWind_DE.rsProducts.State = adStateOpen then
NWind_DE.rsProducts.Close
end if
NWind.rsProducts DataCombo1.BoundText
set Datagrid1.DataSource = NWind_DE.rsProducts

By all accounts, this should work. Instead, I get:

"
Run-time error '-2147417848 (80010108)':

Method 'DataSource' of object 'IDataGrid' failed
"

The next time I try and run this app, VB *crashes*. A very nasty problem -
especially considering we have a very large VB project ahead of us, which
could profit greatly from bound controls.

-J-

In article <795ef0$p5v$1...@nnrp1.dejanews.com>,

Jay Andrew Allen
Senior Programmer, Real Time Enterprises (http://www.rte.com/)

danie...@my-dejanews.com

unread,
Feb 17, 1999, 3:00:00 AM2/17/99
to

I respectfully submit that we're all correct here. In the original context
that I identified this as an ADO bug, it *was* an ADO bug that the person was
experiencing. But ADO is not the only place that this bug can crop up.
"esmith" was correct when he said (below) 'Actually, this not not limited to
ADO.' This bug can crop up, I believe, in any COM object that does not behave
itself upon destruction. I am not a COM expert, so I cannot explain the
details, but this is my understanding of the problem. I don't think that
binary compatibility has anything to do with it, but maybe that is a related
issue in the MTS context you cite.

Dan Read
Atlanta, GA

In article <eueanCFW#GA....@uppssnewspub05.moswest.msn.net>,


"Jan Tore Lamoey" <jan-tor...@isi.no> wrote:
> ADO ins't the problem here, thats also my guess.
> I have also experienced this with components placed within MTS. The error
> appears when there are components that are having trouble with the binary
> compatibility (even though VB compiled the components without complaining
> about the compatibility).
> The solution there was to replace the components with one compiled without
> binary compatibility, but this is not an option here.
>
> Jan Tore
>
> <esmi...@my-dejanews.com> wrote in message
> news:795ef0$p5v$1...@nnrp1.dejanews.com...

danie...@my-dejanews.com

unread,
Feb 17, 1999, 3:00:00 AM2/17/99
to jay_a...@my-dejanews.com
Jay,

You are absolutely correct to be concerned by this ADO bug. It is even more
insidious with these data environment things because you don't have control
over the error handling scheme used with the data environment classes--unless
you're willing to change all of the ADO-related error handlers in every data
environment class you create. I can work around it in my code, because I
write all my own classes, and I can create an error handling scheme that is
not dependent upon Err.Raise. But if you build a project around these data
environments, then you'll have to wait for MS to fix the bug.

I do not use VB6, so I have not experienced the subsequent crash you speak
of, but it doesn't surprise me. Actually, you're lucky to be getting the
method and object names in your error messages--usually all you get is
"Method of '~' object '~' failed". I can also say that the -2147417848 error
number you're getting is not one of the two standard error numbers that ADO
raises for back-end errors, so your error is originating at the data source.
So your code may indeed have a problem. And that's the really evil part: the
error does not have to be an ADO error to be effected by this bug--it just
has to originate in any procedure that uses an ADO object. When you call
Err.Raise from that procedure, ADO destroys the Err.Source and
Err.Description information. Every little "Type Mismatch" and "Invalid Use
of Null" error will be hidden from you--unless you develop an error handling
scheme that is not dependent upon Err.Raise.

This bug really pisses me off because MS has yet to acknowledge it. I know
from internal MS sources that the bug is well known inside MS. Their internal
consultants have been complaining about it since last summer--I've seen the e-
mails. In the absence of any word from MS on when or if this bug will be
fixed, I would seriously reconsider designing a VB6 project around data
environment classes.

HTH,
Dan Read
Atlanta, GA

In article <7a99k9$fqh$1...@nnrp1.dejanews.com>,


Jay Andrew Allen <jay_a...@my-dejanews.com> wrote:
> For the record, I produced this problem in VB6 through the following steps:
>
> * Create a Data Environment and define two commands on the Northwind DB: A
> Suppliers command that reads the Suppliers table, and a Products command that
> restricts its output to a supplied Supplier ID.
> * Create a DataCombo and bind the Suppliers commands to its RowMember. Set
> ListField to CompanyName, and BoundColumn to SupplierID.
> * Create a DataGrid.
> * Set the DataCombo's Change event so that, when a new supplier is selected,
> the following executes:
>
> if NWind_DE.rsProducts.State = adStateOpen then
> NWind_DE.rsProducts.Close
> end if
> NWind.rsProducts DataCombo1.BoundText
> set Datagrid1.DataSource = NWind_DE.rsProducts
>
> By all accounts, this should work. Instead, I get:
>
> "
> Run-time error '-2147417848 (80010108)':
>
> Method 'DataSource' of object 'IDataGrid' failed
> "
>
> The next time I try and run this app, VB *crashes*. A very nasty problem -
> especially considering we have a very large VB project ahead of us, which
> could profit greatly from bound controls.
>
> -J-
>
> In article <795ef0$p5v$1...@nnrp1.dejanews.com>,
> esmi...@my-dejanews.com wrote:

> Jay Andrew Allen
> Senior Programmer, Real Time Enterprises (http://www.rte.com/)
>

0 new messages