+ Reply to Thread
Results 1 to 9 of 9

Importing file name index.csv with adodb error

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,946

    Importing file name index.csv with adodb error

    Hi Guys,

    i have issues with importing "Index.csv" file name.
    (in attachment).

    Code to import this file:
    Please Login or Register  to view this content.
    getting error "SYNTAX error in FROM clause".

    When i am changing this file name to "Index2.csv" it is read without any issues!
    Why?

    Please help,
    Jacek
    Attached Files Attached Files

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Importing file name index.csv with adodb error

    I assume it is one of those words that you can't use in the name because it is reserved? since you are just selecting all, you could open it, copy the contents and then close it again, but I don't think you can do this with an SQL statement.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,056

    Re: Importing file name index.csv with adodb error

    Use square brackets:

    Please Login or Register  to view this content.
    also note that fields are indexed starting at 0 not 1.
    Everyone who confuses correlation and causation ends up dead.

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Importing file name index.csv with adodb error

    Oops, didn't think of that... good call rorya

  5. #5
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,946

    Re: Importing file name index.csv with adodb error

    Hmm interesting, thank you.

    Why with square brackets is working and why without not? Is really index reserved word?

    best,
    Jacek

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,056

    Re: Importing file name index.csv with adodb error

    It is in SQL generally (used for creating indices) so I would assume it is with the ACE OLEDB provider.

  7. #7
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,946

    Re: Importing file name index.csv with adodb error

    hmm interesting, i mean it is first time when i have problem with reading CSV and i am importing about 40 tables into my workbook.

    Anyway,
    thank you for help,
    Jacek

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,056

    Re: Importing file name index.csv with adodb error

    It is always safer to put field names and table names in square brackets.

  9. #9
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,946

    Re: Importing file name index.csv with adodb error

    Thanks, lesson learned.

    Best,
    Jacek

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Connecting to CSV file via ADODB connection throwing error : no default driver name
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2020, 09:59 AM
  2. [SOLVED] Error importing data from csv file
    By GerPis in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-04-2018, 12:27 PM
  3. [SOLVED] ADODB.Connection Generating Error on File Located on Cloud
    By masouder in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-12-2017, 03:42 PM
  4. Error while importing sheets from other Excel files into one file
    By AadVissers in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-07-2015, 03:53 PM
  5. [SOLVED] Made big error importing text file with dates
    By excelaron in forum Excel General
    Replies: 3
    Last Post: 07-11-2012, 07:36 PM
  6. [SOLVED] Error importing txt file
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-01-2012, 09:46 AM
  7. Error: during importing an excel file into an online system
    By aveeator in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 02-13-2011, 12:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1