Microsoft KB Archive/329964

= FIX: Microsoft SQL Server ODBC Driver cannot retrieve output parameters of a remote stored procedure on a linked server =

Article ID: 329964

Article Last Modified on 11/15/2007

-

APPLIES TO


 * Microsoft Data Access Components 2.7 Service Pack 1
 * Microsoft Data Access Components 2.8

-



This article was previously published under Q329964



SYMPTOMS
If you run a remote stored procedure with output parameters on a linked server through an ODBC driver for SQL Server, the ODBC driver cannot retrieve the output parameter and you may receive the following error message:

[Microsoft][ODBC SQL Server Driver]Restricted data type attribute violation



RESOLUTION
A supported hotfix is now available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next service pack that contains this hotfix.

To resolve this problem, submit a request to Microsoft Online Customer Services to obtain the hotfix. To submit an online request to obtain the hotfix, visit the following Microsoft Web site:

http://go.microsoft.com/?linkid=6294451

Note If additional issues occur or any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. To create a separate service request, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

' The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.

MDAC 2.7 Service Pack 1
  Date         Time   Version          Size     File name --  12-Nov-2002  02:42  2000.81.9031.12   24,576  Odbcbcp.dll 12-Nov-2002 02:41  2000.81.9031.12  385,024  Sqlsrv32.dll

MDAC 2.8
  Date         Time   Version         Size     File name -  15-Jun-2004  00:22  2000.85.1045.0   28,672  Dbnmpntw.dll 15-Jun-2004 00:21  2.80.1045.0     147,456  Msadds.dll 15-Jun-2004 00:21  2.80.1045.0     512,000  Msado15.dll 15-Jun-2004 00:21  2.80.1045.0     163,840  Msadomd.dll 15-Jun-2004 00:21  2.80.1045.0     184,320  Msadox.dll 15-Jun-2004 00:21  2.80.1045.0      53,248  Msadrh15.dll 15-Jun-2004 00:21  2.80.1045.0     225,280  Msdaora.dll 15-Jun-2004 00:21  2.80.1045.0     147,456  Msdart.dll 15-Jun-2004 00:21  2.575.1045.0    139,264  Msorcl32.dll 15-Jun-2004 00:21  3.525.1045.0    221,184  Odbc32.dll 15-Jun-2004 00:22  2000.85.1045.0   24,576  Odbcbcp.dll 15-Jun-2004 00:21  2.80.1045.0     442,368  Oledb32.dll 15-Jun-2004 00:21  2000.85.1045.0  503,808  Sqloledb.dll 15-Jun-2004 00:21  2000.85.1045.0  401,408  Sqlsrv32.dll 15-Jun-2004 00:08  2000.85.1045.0  208,896  Sqlxmlx.dll Note For a list of all the hotfixes available for MDAC 2.8, click the following article number to view the article in the Microsoft Knowledge Base:

839801 FIX: Hotfixes are available for MDAC 2.8



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



Steps to reproduce the behavior
  Use the following code to create a SQL Server stored procedure with output parameters on a linked server: USE pubs GO

CREATE PROCEDURE dbo.sample_stored_procedure @op varchar(20) output AS   set @op = 'demo string' return 0 GO Note You do not receive the error message that is listed in the &quot;Symptoms&quot; section if the stored procedure returns a result set.   The following Microsoft Visual Basic application sample code accesses the remote stored procedure on a linked server. In the following code sample,  and   are the two servers that are running SQL Server, and   as a linked server on. Dim cn As new ADODB.Connection Dim cmd As new ADODB.Command Dim prm As ADODB.Parameter

cn.Open &quot;Driver={SQL Server};Server=srv1;UID=sa;PWD=sa_password;&quot; cmd.ActiveConnection = cn   cmd.CommandType = adCmdStoredProc cmd.CommandText = &quot;srv2.pubs.dbo.sample_stored_procedure&quot;

Set prm = cmd.CreateParameter(&quot;op&quot;, adVarChar, adParamOutput, 20) cmd.Parameters.Append prm

cmd.Execute Debug.Print prm.Value

cn.Close

Set cn = Nothing 

Keywords: kbqfe kbhotfixserver kbbug kbfix KB329964

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.