如何阻止MS Access更改我的SQL代码? [英] How to stop MS Access from changing my SQL code?

查看:82
本文介绍了如何阻止MS Access更改我的SQL代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在MS Access中编写了一个SQL查询,Access弄乱了它,只是将其显示为图形". 如何阻止它执行此操作?

I've wrote an SQL query in MS Access and Access made a mess of it, only to show it "graphical". How do I stop it from doing this?

推荐答案

如果将SQL保存为QueryDef对象(例如,使用图形查询编辑器),则不会阻止Access更改您的SQL.您还有(至少)两个其他选择:

There's no stopping Access from changing your SQL if you save it as a QueryDef object (ie, using the graphical query editor). You have (at least) two other options:

  1. 在VBA中构建查询
  2. 将查询存储在专用于使用Memo字段存储SQL的查询的表中(这还需要一些VBA来使用SQL并执行它,或将其分配给临时querydef等)

如果需要,您仍然可以使用QBE(示例查询)窗口来最初生成SQL.

You can still use the QBE (query-by-example) window to generate your SQL initially if you want.

此外,如果您有非Jet后端(例如,MS SQL Server),则可以编写传递查询.您失去了图形界面,但获得了在所选后端中编写SQL的所有功能. Access不会重新调整传递查询的格式.

Also, if you have a non-Jet backend (MS SQL Server, for example) you can write pass-through queries. You lose the graphical interface but gain all of the functionality of writing SQL in your backend of choice. Access won't rearrange the formatting on pass-through queries.

这篇关于如何阻止MS Access更改我的SQL代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆