Use MS Query in VBA to only get a SQL statement



I wonder if this were possible:
Use MS Query to construct a SQL statement and use the statement in VBA code (ADO, ODBC connecting to Interbase), but don't let it run the statement.
So just use the MS Query as a SQL wizard, incorporated in VBA code.
Doing this would save a lot of coding to get a similar wizard, although it shouldn't be too difficult either.
One drawback I can see is that MS Query won't let you do a WHERE condition on a field that is not in the SELECT
clause. The good thing though is that it will automatically add any joins, although I am not sure how it will handle
joins that are not inner joins.
Hope this explains it clear enough and thanks for any advice.


RBS

.



Relevant Pages

  • RE: Calendar Question
    ... If you are working on top of an Access table you could use an UPDATE query to ... put the field reference directly in the sql statement. ... am using does generate Thanks for assistance Biz Enhancer. ... then copy the SQL statement into the VBA code ...
    (microsoft.public.access.forms)
  • RE: Updating a value using SQL
    ... make a standalone query out of your SQL statement (let's call ... then do this in VBA code to set: ... Private Sub ComboBox1_AfterUpdate ...
    (microsoft.public.access.formscoding)
  • Re: Text Formatting: Add "." to text
    ... For example in VBA code: ... if you are doing this in a query you can use the iif function to do this also: ... Leslie W. wrote: ... I wrote the following SQL statement: ...
    (microsoft.public.access.queries)
  • Re: Select Count Random
    ... The only way to do this is to build up the SQL statement using VBA code. ... What do you do with the results of the query? ... But i need it to do a Random Select of a Qty PIN ...
    (microsoft.public.access.queries)
  • RE: Use MS Query in VBA to only get a SQL statement
    ... The optimal place to get your SQL statements is from MS Access as Access will ... SQL view and simply copy and paste the query into your Excel VBA module. ... > So just use the MS Query as a SQL wizard, incorporated in VBA code. ...
    (microsoft.public.excel.programming)

Loading