RE: Disappearing SQL Code



No way to tell from your post. Would you post the VBA code you are using?

How do you start the process?

--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


"bgetson" wrote:

I have a pretty simple select query that does some minor calculations,
but for some reason, the SQL code inisde of the query keeps getting
erased. Every night I run a process from Excel that tells Access to
export the data from two different queries. The same subroutine
handles both queries (from a variable parameter) and uses the
DoCmd.OutputTo command to export both queries as an .xls file.

If the SQL is working beforehand, the process runs fine, and the
queries are exported. Afterwards, the query is only left with
"SELECT;". As far as I can tell, this is the only process that
references this specific query.

As a side note, the other query is a union query. Also, this process
has run fine in the past, and it is only recently when I added an
additional table to the database (which doesn't affect any queries)
that any of this started happening. The only change to the relevant
data structure is that I changed that name of a table I was
referencing. However, even if I create a fresh select query and copy
the SQL into it, the same problems occur.

Any ideas? It's getting tedious to copy the SQL in every morning.
Thanks for your help.

.



Relevant Pages

  • Re: Official Status of SQLServer 2005 ADP
    ... I have said that the support for SQL passthrough ... queries under MDB was bad and worst than the one offered by ADP while you ... > attempt to "pass through" every Access query against a linked ODBC ...
    (microsoft.public.access.adp.sqlserver)
  • Re: "Query Too Complex" Errors
    ... few dozens of queries, in the middle of which there's a long chain of ... we've been having a lot of those "Query Too ... some of the complexity in the SQL ... SQL statement you are working on. ...
    (microsoft.public.access.forms)
  • Re: Dynamic query problem
    ... On Oct 17, 9:41 am, Andy Hull ... If we were to provide a fully featured dynamic query generator we would have ... Provided with already built queries which they can edit ... SQL and see where it is the same as for the other queries and where it ...
    (microsoft.public.access.queries)
  • Re: CONTAINS performance
    ... mark, FTS needs to be very carefully tuned to achieve second response times, ... see SQL Server 2000 BOL title "Full-text Search Recommendations" for more ... When you include the "TOP 100" in your query, you are in fact limiting the ... valid for SQL queries, they often do not apply to FTS queries because the FT ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Populating a list -- learning Access
    ... It is kinda funny -- I started using databases in the early 80's with dBase and, for years, never knew that I knew SQL! ... If you are on a form or report, the most important property is the NAME, because that is how you refer to it in code. ... I don't mean to skip your responce below, but thanks to your help with SQL, I was able to get the query to pull the info the way I needed. ... Queries (just shows the QBE grid for convenience -- ...
    (microsoft.public.access.forms)