title: VBA ADODB - Getting Parameters from parameterized query
body: <p>I´m trying to get parameters names from a parameterized query stored in a MS Access database using this code:</p>
  
  <pre><code>Dim cmd As New ADODB.Command
  Dim cnn As ADODB.Connection
  
  Set cnn = CurrentProject.Connection
  
  With cmd
      .ActiveConnection = cnn
      .CommandType = adCmdStoredProc
      .NamedParameters = True
      .CommandText = "nameOfParameterizedQuery"
      .Parameters.Refresh
  End With
  
  ......
  </code></pre>
  
  <p>However it doesn´t work, since Parameters collection remains empty. I´ve tried to define parameters adding the following code before the SELECT statement in the SQL query as:</p>
  
  <pre><code>PARAMETERS [parameter1] Datatype, [parameter2] Datatype .... ;
  SELECT ....
  </code></pre>
  
  <p>But I have had no success. I´ve read that Microsoft Access ODBC and OLE DB drivers do not currently support automatic parameter population.</p>
  
  <p>Is that true? Is there any way to use ADO to get parameters names from a parameterized query in a MS Access database?</p>
  
  <p>Thanks in advance.</p>