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?
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?
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
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?
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
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?
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