title: Issue selecting from a view with ODBC via Excel (MariaDB ODBC 3.1 Driver)
body: <p>I have an Excel spreadsheet which is connecting to a MariaDB database via ODBC and pulling data.
  If I query a normal table, everything works fine. However, if I try to select from a view, I get an error.
  My connection string is in the format:</p>
  <pre><code>ODBC;Driver={MariaDB ODBC 3.1 Driver};Server=&lt;IPAddress&gt;;Database=&lt;DBName&gt;;UID=&lt;UserName&gt;;PWD=&lt;Password&gt;
  </code></pre>
  <p>If I issue just the most simple &quot;Select * from MyView&quot; or &quot;Select count(*) from MyView&quot;, I get a &quot;General ODBC&quot; error with code 1004. As mentioned, I can select from any table in the database without any issue.</p>
  <p>I use the following code to fetch the data into a range (the sub &quot;getConnectionString&quot; returns the connection string I mentioned earlier):</p>
  <pre><code>        With ActiveSheet.ListObjects.Add(SourceType:=0, source:= _
              getConnectionString(&quot;ODBC&quot;), Destination:=range(&quot;$AW$13&quot;)).QueryTable
              .CommandText = sql
              .RowNumbers = False
              .FillAdjacentFormulas = False
              .PreserveFormatting = True
              .RefreshOnFileOpen = False
              .BackgroundQuery = True
              .RefreshStyle = xlInsertDeleteCells
              .SavePassword = False
              .SaveData = True
              .AdjustColumnWidth = True
              .RefreshPeriod = 0
              .PreserveColumnInfo = True
              .Refresh BackgroundQuery:=False
          End With
  </code></pre>
  <p>If I try via an Adodb Connection, I get a different error. But the common theme is not being able to select from a view.</p>
  <pre><code>    Dim cnDB As New ADODB.Connection
      Dim rsRecords As New ADODB.Recordset
      Set cnDB = getConnection
      sql = &quot;Select count(*) from MyView&quot;
      rsRecords.Open sql, cnDB
  </code></pre>
  <p>Gives the following error:</p>
  <pre><code>-2147467259
  [ma-3.1.7][10.1.25-MariaDB-enterprise]Prepared statement needs to be re-prepared
  </code></pre>