title: ADODB Connection String for .csv
body: <p>I want to process .csv files with ADODB in Excel VBA. I tried a few strings found on web, but none of them seems to work. I'm getting file path using:</p>
  
  <pre><code>strVFile = Application.GetOpenFilename("CSV (*.csv), *.csv")
  </code></pre>
  
  <p>And then I pass <code>strVFile</code> as a parameter to the sub <code>objReport.Load strVFile</code>. The header of the sub is: <code>Public Sub Load(ByVal strFilename As String)</code>.</p>
  
  <p>Then I try to make ADODB connection using string: </p>
  
  <pre><code>pconConnection.ConnectionString = _
              "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &amp; strFilename &amp; _
              ";Extended Properties=""text;HDR=Yes;FMT=Delimited(;)"";Persist Security Info=False"
      pconConnection.Open
  </code></pre>
  
  <p>When I run the macro and choose CSV file, there's error occuring saying that "given path is not a valid path". What am I doing wrong?</p>
  
  <p><strong>Edit (Code)</strong>,</p>
  
  <p>Module mdlReport </p>
  
  <pre><code>Public Sub Report()
      Dim objReport As clsReport
  
  
      MsgBox "Please select .csv file", vbInformation + vbOKOnly
      strVFile = Application.GetOpenFilename("CSV (*.csv), *.csv")
  
      If strVFile &lt;&gt; False Then
          Set objReport = New clsReport
  
          objReport.Load strVFile
  
      End If
  End Sub
  </code></pre>
  
  <p>Class clsReport</p>
  
  <pre><code>Private pconConnection As ADODB.Connection
  Private prstRecordset As ADODB.Recordset
  
  Private Sub Class_Initialize()
    Set pconConnection = New ADODB.Connection
    pconConnection.ConnectionTimeout = 40
  End Sub
  
  Public Sub Load(ByVal strFilename As String)
  
      pconConnection.ConnectionString = _
              "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &amp; strFilename &amp; _
              ";Extended Properties=""text;HDR=Yes;FMT=Delimited(;)"";Persist Security Info=False"
      pconConnection.Open
  
  End Sub
  </code></pre>