title: Error loading file pipe-separated text using odbc
body: <p>I am making an import of data from a text delimited pipe (|) file into a Web page Asp net ... the code is as follows:</p>
  
  <pre><code>Dim rutaFuente As String = "c:\Logs\"
  Dim archivosFuente As String = "DatosPersona.csv"
  Using con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &amp; rutaFuente &amp; ";" _
                               &amp; "Extended Properties=""TEXT;HDR=Yes;FMT=Delimited(|)""")
  
  Using cmd As New OleDbCommand(String.Format("SELECT * FROM [{0}]", archivosFuente), con)
      con.Open()
  
      Using adp As New OleDbDataAdapter(cmd)
          Dim tbl As New DataTable("TablaArchivosSeparados")
          adp.Fill(tbl)
        GridView1.DataSource = tbl.TableName("TablaArchivosSeparados")
              GridView1.DataBind()
  
          End Using
      End Using
  End Using
  </code></pre>
  
  <p>but I get error on line adp.Fill(tbl) saying:</p>
  
  <p>"It is already opened exclusively by another user or you need permission to view its data, and check that the file does not have read-only permission or any protection, or the directory is restricted".</p>
  
  <p>these same lines of code have them on a console and work perfectly when I write (Console.writeline(item)) row of the data table For Each row As DataRow In tbl.Rows</p>
  
  <pre><code>   For Each row As DataRow In tbl.Rows
           For Each item In row.ItemArray
                Console.WriteLine(item)
           Next
     Next
  </code></pre>
  
  <p>why I get this error??</p>