FIX: OLE Automation Fails When Calling ADODB.Connection Methods (295046)
The information in this article applies to:
- Microsoft SQL Server 2000 (all editions)
This article was previously published under Q295046
BUG #: 352807 (SHILOH_BUGS)
SYMPTOMS
Using the sp_OAMethod OLE automation system stored procedure with a connection object ID as an integer datatype may generate an error of type -2146825287 and the corresponding error description:
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
RESOLUTIONTo resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, click the following article number to view the article in the
Microsoft Knowledge Base:
290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack
WORKAROUND
Use a connection string instead of a connection object ID:
EXEC @iRetCode = sp_OAMethod @iRSTObjId,'Open',null,'error_log',@sConnString,2,3,2
select @iRetCode
-- or
EXEC @iRetCode = sp_OAMethod @iRSTObjId,'Open',null,'error_log','Data Source=SERVERNAME;Provider=SQLOLEDB; Initial Catalog=pubs; Integrated Security=SSPI',2,3,2
select @iRetCode
STATUSMicrosoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.
Modification Type: | Major | Last Reviewed: | 11/5/2003 |
---|
Keywords: | kbBug kbfix kbSQLServ2000sp1fix KB295046 |
---|
|