title: Export specific columns from Access table to CSV using SELECT ... INTO
body: <p>I'm able to select an entire table from an Access database, into a CSV using the following code via VB.NET:</p>
  
  <pre><code>Dim AccessCommandCust As New OleDbCommand("SELECT * INTO [Text;DATABASE=C:\TEMP].[CUSTOMERS.csv] FROM Customers", AccessConn)
  </code></pre>
  
  <p>However, I don't need the entire table, just two columns -- Firstname and Lastname.  The SQL is simple enough, but when I attempt this using the following code:</p>
  
  <pre><code>Dim AccessCommandCust As New OleDbCommand("SELECT FirstName, LastName INTO [Text;DATABASE=C:\TEMP].[CUSTOMERS.csv] FROM Customers", AccessConn)
  </code></pre>
  
  <p>It raises an exception:</p>
  
  <blockquote>
    <p>Microsoft Jet database engine could not find the object 'CUSTOMERS.csv').</p>
  </blockquote>
  
  <p>I'm trying to figure out where I'm going wrong.</p>