Results 1 to 6 of 6
  1. #1
    violeta_barajas is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2016
    Posts
    13

    Where are the DDL of the Query Objects stored?

    Hi,

    I've been searching on the MSysObjects and MSysQueries intertal tables for the all the DDLs of the Query Objects of my database but apparently only the SELECT statements are stored here.



    Do you what internal table the DDLs are stored in?

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    do you mean DLL's?

    They are referenced in VBA code. In the VBA window, select tools>references

    Or do you mean the code to create/amend tables etc. If so I believe they are created on the fly when you save changes to tables etc. See these links

    http://allenbrowne.com/func-DDL.html

    http://www.w3schools.com/sql/sql_create_table.asp

    You can also look at the querydefs and tabledefs collections

    https://msdn.microsoft.com/en-us/lib.../ff194892.aspx
    https://msdn.microsoft.com/en-us/lib...ffice.12).aspx

  3. #3
    violeta_barajas is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2016
    Posts
    13
    I meant DDL and also DML. I would like to know if there is a fastest way to consult all SQL behind each Query Object that replaces the manual way of opening each object to check its SQL. Are these SQL stored somewhere?

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    they are stored in the querydef. Put this code in a module and run it

    Code:
    Sub printSQL()
    Dim qry as querydef
    for each qry in currentdb.querydefs
        debug.print qry.sql
    next qry
    End Sub

  5. #5
    violeta_barajas is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2016
    Posts
    13
    Thanks Ajax.

    I'm running it pressing Ctrl + G and also tried from a Macro but so far with no success. How is it executed?

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    click on any code line in the sub (i.e. not dim line) and then the F5 key or Run>Sub/Userform or the green triangle

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

Similar Threads

  1. how to call stored Query
    By mks123 in forum Programming
    Replies: 6
    Last Post: 05-10-2015, 10:25 AM
  2. Replies: 3
    Last Post: 01-14-2014, 03:56 PM
  3. Query for 2 Objects
    By mimireyes in forum Queries
    Replies: 3
    Last Post: 11-13-2012, 10:48 PM
  4. Replies: 4
    Last Post: 01-03-2012, 08:11 PM
  5. query objects in VB6
    By genesis in forum Access
    Replies: 1
    Last Post: 07-10-2009, 02:16 AM

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