Auto SQL editor

Auto SQL editor

am 27.12.2007 02:04:43 von wak

Hello,

I'm using MS Access 2003 for a software program I'm creating. The
program makes use of some complicated queries that I'm storing inside
the Access database.

Access keeps rearranging the lines and spacing inside the SQL queries,
making it difficult to go back and edit them. How can I turn off this
annoying "feature" so that new lines and whitespace characters are
left alone?

Thanks.

--
Winston Kotzan

Re: Auto SQL editor

am 27.12.2007 02:44:32 von Allen Browne

You can't turn this off. If you store them as queries in Access, it will
modify the SQL statement whenever you alter the query in design view, and it
will handle its own line endings even when you save it in SQL View.

Perhaps you could save your queries in the Memo field of a Table instead of
in the query window. You can then grab the text from the table and run it in
code, or assign it to the SQL property of a temporary QueryDef set up for
the purpose. Example:
strSql = DLookup("MyMemoField", "MyTable", "ID = 99")
CurrentDb.QueryDefs("MyTempQuery").SQL = strSql

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

wrote in message
news:6e14684e-ee8e-4885-964c-9c25de2c0ae2@l32g2000hse.google groups.com...
> Hello,
>
> I'm using MS Access 2003 for a software program I'm creating. The
> program makes use of some complicated queries that I'm storing inside
> the Access database.
>
> Access keeps rearranging the lines and spacing inside the SQL queries,
> making it difficult to go back and edit them. How can I turn off this
> annoying "feature" so that new lines and whitespace characters are
> left alone?
>
> Thanks.
>
> --
> Winston Kotzan

Re: Auto SQL editor

am 27.12.2007 02:52:23 von wak

Thanks for the reply.