Results 1 to 3 of 3
  1. #1
    WirelessValve is offline Novice
    Windows XP Access 2016
    Join Date
    Oct 2017
    Location
    United Kingdom
    Posts
    1

    Is there an add-in to allow Access to read SQL directly from a text file?

    Hi


    Does anyone know of an Add-in that will allow Access to process SQL directly from a text file? It would save the need to place the statements in literal strings within a VBA module.




    I am thinking of a file similar to a MySQL Script. I am not asking for full MySQL compatibility, just the ability to write all my Access SQL statements in a single file in plain text and comment them properly.


    I have written a program in VBA to do this and that has greatly improved my Access experience. But I wonder if there is a professionally developed product available?


    Any advice gratefully appreciated.


    Mark

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Import the file into a table and read the SQL from there.

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    But I wonder if there is a professionally developed product available?
    your issue is 'comment them properly' Access sql does not have comment flags as you will find in TSQL or MySQL, but it is not difficult to write your own interpreter for access. There are plenty of web based sql formatting solutions online. Don't know about an add-in, you could try FMS who do all things Access.

    I do something similar to aytee, I have a table of richtext memo fields for the sql and inline comments together with a few other fields for description, ID etc, one per sql query. My comments are highlighted green or red (just because I can), rather than using specific characters to identify start and end of comments. I also have code to highlight keywords blue (such as SELECT, FROM, etc)

    then I have a simple function where I pass the ID, the table is interrogated and the memo field returned as plain text, then I simply strip out all the comments (identified by the html tags) to return a pure sql string.

    Or you could just use MySQL as a backend and use pass through queries to call the queries created there.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Importing file directly from a Sharepoint file (not list)
    By jstoler in forum Import/Export Data
    Replies: 1
    Last Post: 06-28-2013, 01:44 PM
  2. Read excel/text file thro VBA
    By shabar in forum Programming
    Replies: 2
    Last Post: 01-29-2013, 04:41 AM
  3. Read text file with LF
    By SteveG in forum Programming
    Replies: 8
    Last Post: 12-24-2011, 09:57 AM
  4. Err 7-out of memory, read text file
    By dssrun in forum Programming
    Replies: 4
    Last Post: 12-04-2011, 01:06 AM
  5. Why 2 users cant open an access file directly???
    By finnegan bell in forum Access
    Replies: 6
    Last Post: 03-22-2009, 09:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums