title: Data type 0x23 is a deprecated large object, or LOB, but is marked as output parameter
body: <p>I'm trying to receive a <code>varchar(max)</code> output <code>param</code> from an <code>stored procedure</code> but I'm getting the error above , i.e <code>Data type 0x23 is a deprecated large object, or LOB, but is marked as output parameter</code> when I execute the <code>SP</code> in <code>vb.net</code></p>
  
  <p>I have tried using <code>SQLNCLI11</code> connection string, no luck
  I have tried setting <code>Datatypecompatibility=80</code>, no luck</p>
  
  <p>thanks in advance.</p>
  
  <p>here are my codes:</p>
  
  <pre><code> Private Sub Button1_Click(sender As Object, e As EventArgs) Handles     Button1.Click
      Dim cmd As ADODB.Command
      Dim Rs As ADODB.Recordset
      Dim prm As ADODB.Parameter
      Dim db As New ADODB.Connection
      Dim PromoRejectDesc As String = ""
  
      db.ConnectionString = "Provider=SQLNCLI11;UID=user;Pwd=password;Database=POSData;Server=localhost;DataCompatibility=80;MARS Connection=True"
  
      db.Open()
  
      cmd = New ADODB.Command
      cmd.ActiveConnection = db
      cmd.CommandType = ADODB.CommandTypeEnum.adCmdStoredProc
      cmd.CommandText = "DBO.proc_PromoRejectingFactors"
  
      prm = cmd.CreateParameter("@CustID", ADODB.DataTypeEnum.adInteger, ADODB.ParameterDirectionEnum.adParamInput)
      prm.Value = 1050009326
      cmd.Parameters.Append(prm)
      prm = cmd.CreateParameter("@BranchID", ADODB.DataTypeEnum.adInteger, ADODB.ParameterDirectionEnum.adParamInput)
      prm.Value = 101
      cmd.Parameters.Append(prm)
      prm = cmd.CreateParameter("@FulfillmentChannel", ADODB.DataTypeEnum.adInteger, ADODB.ParameterDirectionEnum.adParamInput)
      prm.Value = 1
      cmd.Parameters.Append(prm)
      prm = cmd.CreateParameter("@Tender", ADODB.DataTypeEnum.adInteger, ADODB.ParameterDirectionEnum.adParamInput)
      prm.Value = 0
      cmd.Parameters.Append(prm)
  
      prm = cmd.CreateParameter("@CreditCard", ADODB.DataTypeEnum.adInteger, ADODB.ParameterDirectionEnum.adParamInput)
      prm.Value = -1
      cmd.Parameters.Append(prm)
  
      prm = cmd.CreateParameter("@ExcludePromo", ADODB.DataTypeEnum.adVarChar, ADODB.ParameterDirectionEnum.adParamInput, 1000)
      prm.Value = ""
      cmd.Parameters.Append(prm)
  
      prm = cmd.CreateParameter("@PromoRejectDesc", ADODB.DataTypeEnum.adLongVarChar, ADODB.ParameterDirectionEnum.adParamOutput, 9999)
      cmd.Parameters.Append(prm)
  
      Rs = cmd.Execute
      If Rs.State = 1 Then
          PromoRejectDesc = prm.Value
          MsgBox(PromoRejectDesc)
      End If
  End Sub
  </code></pre>