title: Access VBA - while importing *.CSV I'm getting Run time error 31519. You can not import this file
body: <p>While using DoCmd.TransferText Method in Access, I'm getting error described in the question title.
  My code is taking file names from the table in current database (these are files selected from somewhat above 2000 files present in the single folder) and its goal is to import these files' content to the one table in Access.
  Please read this topic for more info:
  <a href="https://stackoverflow.com/questions/44610427/vba-procedure-to-import-only-selected-csv-files-from-one-folder-into-a-single/44611380?noredirect=1#comment76227720_44611380">VBA procedure to import only selected csv files (from one folder) into a single table in access</a></p>
  
  <p>All files have the same structure and data type.<a href="https://i.stack.imgur.com/YV5a4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YV5a4.png" alt="enter image description here"></a></p>
  
  <p>here is the code I'm using:</p>
  
  <pre><code> Sub Importing_data_into_a_single_table_csv_version()
     Dim my_path As String
     Dim rs As Recordset
     Dim start As Double
     Dim total_time As String
  
       DoCmd.SetWarnings True
       my_path = "C:\Users\michal\SkyDrive\csv\bossa\mstcgl_csv\"     ' source folder.
  
       start = Timer         ' remember time when macro starts.
  
       Set rs = CurrentDb.OpenRecordset("CSV Files")   ' opens the table with file names.
         Do Until rs.EOF
            If Dir(my_path &amp; rs.Fields(0).Value) &lt;&gt; "" Then
            ' DoCmd.TransferText acImportDelim, "macro_link_specification", "all_stocks_3", "my_path &amp; rs.Fields(0).Value", True
               DoCmd.TransferText acImportDelim, "import", "all_stocks_1", "my_path &amp; rs.Fields(0).Value", True
            ' expression. TransferText ( TransferType, SpecificationName, TableName, FileName, HasFieldNames, HTMLTableName, CodePage )
  
            End If
            rs.MoveNext
         Loop
  
     total_time = Format(Timer - start, "hh:mm:ss")
     MsgBox "This code ran successfully in " &amp; total_time, vbInformation
   End Sub
  </code></pre>
  
  <p>The code crashes at <code>DoCmd.TransferText acImportDelim, "import", "all_stocks_1", "my_path &amp; rs.Fields(0).Value", True</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/E0jLN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E0jLN.png" alt="enter image description here"></a>
  Is there some special way a destination table should be prepared to import these files? Sorry for these type of questions, but I'm using Access for 3 weeks now, so I'm just a beginner.
  I'm using import specification called "import". Can this be the cause of the problems?</p>
  
  <p>Here is what the destination table looks like:
  <a href="https://i.stack.imgur.com/Spqes.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Spqes.png" alt="enter image description here"></a></p>
  
  <p>Here is another table I've been trying to import my data into.
  The field names in this table have no special characters and the same data types set on the fields, but it makes no difference. The same error 31519 is returned.</p>
  
  <p><a href="https://i.stack.imgur.com/9W6eq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9W6eq.png" alt="enter image description here"></a></p>