+ Reply to Thread
Results 1 to 2 of 2

ADODB SELECT FROM filename with special character imbedded

  1. #1
    Registered User
    Join Date
    12-02-2011
    Location
    Goodyear, AZ
    MS-Off Ver
    Excel 2010
    Posts
    26

    ADODB SELECT FROM filename with special character imbedded

    Function QS_CsvRecordsetOpen loads a CSV file and returns it as a Recordset. It works perfectly except when there is a special character embedded in pFilename which yields an error "Syntax error in FROM clause".

    Please Login or Register  to view this content.
    The special character is always the first character of the filename. I do not have control over the file names so I have attempted some workarounds based on review of general (non-VBA) SQL SELECT FROM syntax including:
    • identifying and enclosing the special character in square brackets
    • identifying the special character, converting it to a code, and inserting it into the filename with & Chr(code)

    Is there any way to handle this with ADODB recordsets or do I have to revert to the old Input statement to read these? I can't find anything in searches except "don't use special characters in filenames" but that is not under my control.

    Thank you.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,514

    Re: ADODB SELECT FROM filename with special character imbedded

    If you have a problem with the file name, you can save a copy with a different name and read from there.

+ 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] Special Character
    By wacky_diva in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-28-2016, 12:48 AM
  2. [SOLVED] Rename a special filename
    By Jan Lichtenbelt in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 02-28-2016, 01:49 PM
  3. [SOLVED] Getting filename without extension and seperating the value based on a character
    By szpt9m in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-29-2014, 02:17 AM
  4. Need to highlight special character and the cells contains special character
    By dhilipan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-26-2013, 01:36 AM
  5. Remove number and special characters from Filename
    By Elmholt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-30-2012, 06:53 PM
  6. Excel 2000 58 character Filename Limit?
    By NickH in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-26-2006, 07:30 AM
  7. [SOLVED] Special Character
    By Henry in forum Excel General
    Replies: 1
    Last Post: 07-25-2006, 08:10 AM

Tags for this Thread

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