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



The information in this article applies to:

  • Microsoft Data Access Components 2.7 SP1
  • 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, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next MDAC 2.7 service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

' 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 "Applies to" section.

MORE INFORMATION

Steps to reproduce the behavior

  1. 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 "Symptoms" section if the stored procedure returns a result set.
  2. The following Microsoft Visual Basic application sample code accesses the remote stored procedure on a linked server. In the following code sample, srv1 and srv2 are the two servers that are running SQL Server, and you are creating srv2 as a linked server on srv1.
        Dim cn As new ADODB.Connection
        Dim cmd As new ADODB.Command
        Dim prm As ADODB.Parameter
    
        cn.Open "Driver={SQL Server};Server=srv1;UID=sa;PWD=sa_password;"
        
        cmd.ActiveConnection = cn
        
        cmd.CommandType = adCmdStoredProc
        cmd.CommandText = "srv2.pubs.dbo.sample_stored_procedure"
    
        Set prm = cmd.CreateParameter("op", adVarChar, adParamOutput, 20)
        cmd.Parameters.Append prm
    
        cmd.Execute
        Debug.Print prm.Value
    
        cn.Close
    
        Set cn = Nothing
    

Modification Type:MajorLast Reviewed:4/7/2006
Keywords:kbQFE KBHotfixServer kbbug kbfix KB329964 kbAudDeveloper