+ Reply to Thread
Results 1 to 4 of 4

Problems reading text files containing SQL sentences created by SSMS

  1. #1
    Forum Contributor
    Join Date
    09-30-2009
    Location
    Barcelona
    MS-Off Ver
    Excel 2010
    Posts
    274

    Problems reading text files containing SQL sentences created by SSMS

    hi,

    I am trying to make a simple function to transform the queries created in SQL server Management Studio to a multi-line string in VBA so that it is still readable

    but when reading a simple query such as the one attached, I only get some of the lines and there are spaces between all characters




    Please Login or Register  to view this content.
    not a core function, but just in case I add here isFalseString
    Please Login or Register  to view this content.

    not possible to attach sql in attachment...
    you can see the file here
    https://drive.google.com/file/d/0BwF...ew?usp=sharing

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Problems reading text files containing SQL sentences created by SSMS

    It's a UNICODE file.

    Please Login or Register  to view this content.
    More care please - posting code that does not even compile can delay responses and causes extra work for anyone giving their time to help you...

    ...I add here isFalseString
    Please Login or Register  to view this content.
    Last edited by cytop; 11-17-2016 at 05:34 AM.

  3. #3
    Forum Contributor
    Join Date
    09-30-2009
    Location
    Barcelona
    MS-Off Ver
    Excel 2010
    Posts
    274

    Re: Problems reading text files containing SQL sentences created by SSMS

    actually I failed to add "isFalseString" which compares f with whatever getFalseString returns, depending on the system locale
    Thank you for your advice. Indeed with unicode all works better

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Problems reading text files containing SQL sentences created by SSMS

    Hi,

    You can simplify things by declaring f as Variant then simply testing
    Please Login or Register  to view this content.
    which will work in all regions without requiring any additional functions.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

+ 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] Reading data from a list of text files
    By Atom in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-10-2016, 02:56 PM
  2. Reading live text files
    By ar2g13 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-24-2015, 03:18 PM
  3. Better method for reading really large text files into an array using VBA
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2015, 06:08 PM
  4. Reading CSV text files
    By erock24 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-21-2010, 04:55 PM
  5. Problems with reading stuff from closed files
    By bluesdata in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-20-2007, 04:38 AM
  6. Reading Text Files Into Excel (.Read) and Searching Them
    By Mortonic in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-18-2007, 06:06 AM
  7. [SOLVED] PC-created files used on a Mac - Problems
    By JEFF in forum Excel General
    Replies: 4
    Last Post: 07-29-2005, 05:05 PM

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