title: importing multiple *.csv files into access - every file into separate table
body: <p>I have over a thousand files to import into a ACCESS database.
  Every file needs to be imported into separate ACCESS table.
  It needs to support importing this files every day, because, there are polish stocks prices, so every day, around 08 p.m. I'm downloading a *.zip file containing 1000 *.csv files, and I'll need to import them another time, to get today's prices.</p>
  
  <p><a href="https://i.stack.imgur.com/YUEu1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YUEu1.png" alt="enter image description here"></a></p>
  
  <p>I need to have some settings changed, in order to have my data imported correctly.</p>
  
  <p><a href="https://i.stack.imgur.com/ivBca.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ivBca.png" alt="enter image description here"></a></p>
  
  <p>next thing is:
  <a href="https://i.stack.imgur.com/2EKjT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2EKjT.png" alt="enter image description here"></a></p>
  
  <p>advanced settings:
  <a href="https://i.stack.imgur.com/cqscV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cqscV.png" alt="enter image description here"></a></p>
  
  <p>how it looks like.</p>
  
  <p><a href="https://i.stack.imgur.com/1gs4U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1gs4U.png" alt="enter image description here"></a></p>
  
  <p>I don't know how to write these advanced changes in the VBA code.
  In EXCEL I could record the macro, and then see the syntax, with the settings I have chosen, but is it possible to do the same in ACCESS ?</p>
  
  <p>There are two codes I've found on the internet.
  first:</p>
  
  <blockquote>
    <p>Function Impo_allExcel()</p>
  </blockquote>
  
  <pre><code> Dim my_file As String
   Dim my_path As String
  
   my_path = "C:\Users\michal\SkyDrive\csv\bossa\mstcgl_csv"
   ChDir (my_path)              'why my_path is inside the brackets??
  
   my_file = Dir()
  
   Do While my_file &lt;&gt; ""      'is not empty (&lt;&gt; means not equal to), Excel VBA enters the value into
          'this line above doesn't work, when I'm trying to debug it with F8
     If my_file Like "*.csv" Then
       ' this will import ALL the *.CSV files
       '(one at a time, but automatically) in this folder.
       ' Make sure that's what you want.
      DoCmd.TransferSpreadsheet acImport, 8, "Contacts_AVDC_NEW", my_path &amp; my_file
       ' what this above line says ? please explain.
      End If
      my_file = Dir()     ' what it means?
    Loop
    End Function
  </code></pre>
  
  <p>second is:</p>
  
  <blockquote>
    <p>Function Do_Import_from_CSV()</p>
  </blockquote>
  
  <pre><code>  Dim strPathFile As String
    Dim strFile As String
    Dim strPath As String
    Dim strTable As String
    Dim blnHasFieldNames As Boolean
  
    ' Change this next line to True if the first row in CSV worksheet has field names
    blnHasFieldNames = True
    ' real path to the folder that contains the CSV files
    strPath = "C:\Users\michal\SkyDrive\csv\bossa\mstcgl_csv"
  
    ' Replace tablename with the real name of the table into which the data are to be imported
    strFile = Dir(strPath &amp; "*.csv")  'what this line means?
  
     Do While Len(strFile) &gt; 0
         strTable = Left(strFile, Len(strFile) - 4)
         strPathFile = strPath &amp; strFile
         DoCmd.TransferText acImportDelim, , strTable, strPathFile, blnHasFieldNames
  
     ' Uncomment out the next code step if you want to delete the
     ' EXCEL file after it's been imported
     '       Kill strPathFile
  
         strFile = Dir()    'what this means?
    Loop
    End Function
  </code></pre>
  
  <p>Could U please briefly explain these codes for me,
  tell me what is the difference between them,
  and how can I incorporate the settings I need into these codes,
  or into the one that suits me better.
  thanks a lot.</p>