title: VBA: Call SQL Server stored procedure with two arguments
body: <p>Like mentioned in the title, I just want to call a SQL Server stored procedure from VBA.</p>
  
  <p>I can call my stored procedure like this:</p>
  
  <pre><code>  EXEC  dbo.spClientXLS @Nr =  ' 131783', @date = '21.09.2014'
  </code></pre>
  
  <p><code>Nr</code> is a <code>varChar(50)</code> type value, and <code>date</code> is of type <code>date</code></p>
  
  <p>Now, if I want to call it from VBA, I get an error message. My code in VBA is:</p>
  
  <pre><code>...'SQL Server stored procedure which is to execute with parameters
  Dim ADODBCmd As New ADODB.Command
  With ADODBCmd
      .ActiveConnection = objconn
      .CommandTimeout = 500
      .CommandText = "dbo.spClient"
      .CommandType = adCmdStoredProc
  End With
  Set recordset = ADODBCmd.Execute(, date, Nr)
  </code></pre>
  
  <p><code>Date</code> is of type <code>Date</code>, <code>Nr</code> is of type <code>String</code>.</p>
  
  <p>I would be happy, if somebody can explain me, how I can handle it with two arguments.</p>
  
  <p>Regards</p>