BUG: sp_OAGetProperty Fails on Properties From Inherited Interface

ID: Q236440


The information in this article applies to:

BUG #: 18763 (SQLBUG_65)
55840 (SQLBUG_70)

SYMPTOMS

Using sp_OAGetProperty to retrieve a property value from an inherited COM interface fails. If the property value is requested as an OUTPUT parameter, the following error is returned:

Error: 2147745792 (0x80040000)
Source: ODSOLE Extended Procedure
Message: Error in parameters, or attempt to retrieve a return value from a method that doesn't supply one.
When no OUTPUT parameter is supplied, such that sp_OAGetProperty would generate a result set, the command will return an empty result set.


CAUSE

If an OUTPUT parameter is requested, sp_OAGetProperty must confirm that the interface supports the call and that it returns a value that is of the same datatype as the one supplied. However, it fails to correctly walk the object hierarchy to determine this information and will generate an error if this occurs.


RESOLUTION

A supported fix that corrects this problem is now available from Microsoft, but it has not been fully regression tested and should be applied only to systems experiencing this specific problem. If you are not severely affected by this specific problem, Microsoft recommends that you wait for the next SQL Server service pack that contains this fix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information on support costs, please go to the following address on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp
The English version of this fix should have the following file attributes or later:

   Version      File name    Platform
   ------------------------------------

   SQL 6.5      sql451i.exe  x86
   SQL 6.5      sql45ia.exe  Alpha
   SQL 7.0      s70709i.exe  x86
   SQL 7.0      s70709a.exe  Alpha
 
NOTE: Due to file dependencies, the most recent hotfix or feature that contains the above files may also contain additional files.

NOTE: If this product was already installed on your computer when you purchased it from the Original Equipment Manufacturer (OEM) and you need this fix, please call the Pay Per Incident number listed on the above Web site. If you contact Microsoft to obtain this fix, and if it is determined that you only require the fix you requested, no fee will be charged. However, if you request additional technical support, and if your no-charge technical support period has expired, or if you are not eligible for standard no-charge technical support, you may be charged a non-refundable fee.

For more information about eligibility for no-charge technical support, see the following article in the Microsoft Knowledge Base:
Q154871 Determining If You Are Eligible for No-Charge Technical Support


STATUS

Microsoft has confirmed this to be a problem in SQL Server version 6.5 and 7.0.


MORE INFORMATION

Consider, for example, the Command object in Active Data Objects (ADO). In ADO 2.x, the Command object inherits from an interface named _Command15, which was the ADO 1.5 version of the interface. If sp_OAGetProperty is used to request a property in the base interface, such as Parameters, an error occurs. The following code snippet demonstrates the problem:


exec @hr = master.dbo.sp_OACreate 'ADODB.Command', @ADO_Command OUT
if @hr <> 0
begin 
	print "failed in command creation"
	goto fatal_exit
end

...

exec @hr = master.dbo.sp_OAGetProperty @ADO_Command, 'Parameters', @ADO_parms OUT
if @hr <> 0
begin
	print 'Failed in GetProperty'
	goto fatal_exit
end

fatal_exit:
... 
The definition of an object can be seen by using a tool such as the OLE - COM Object Viewer, available as part of Visual C++.

Additional query words: sp_OAMethod


Keywords          : SSrvProg SSrvTran_SQL kbbug6.50 kbbug7.00 kbSQLServ650bug kbSQLServ700bug 
Version           : winnt:6.5,7.0
Platform          : winnt 
Issue type        : kbbug 

Last Reviewed: July 16, 1999