防止访问更改查询 [英] Prevent Access from Changing Queries
问题描述
Microsoft Access 希望在基础对象(表单或查询)不存在时提供帮助并更改我的查询.
Microsoft Access wants to be helpful and change my queries when underlying object (either form or query) does not exist.
例如,如果我有一个执行以下操作的查询...
For example, if I had a query that did the following...
SELECT FirstName
FROM persons
如果person 表还不存在,而我导入了查询,Access 将在FirstName 前面放置一个expr:",表示它找不到该列.稍后将使用 VBA 创建此示例表.
If the persons table does not exist yet, and I import the query, Access will place an "expr: " in front of FirstName signifying that it cannot find the column. This example table will be created with VBA later.
有没有办法阻止 Access 在导入时自动更正查询?
Is there a way to prevent Access from auto-correcting queries upon import?
谢谢!
推荐答案
更改查询以指定别名
SELECT FirstName AS FirstName
FROM Persons
这将阻止 MS Access 为您创建别名.(愚蠢的我知道,但它有效.)
This will prevent MS Acces from creating an alias for you. (Stupid I know, but it works.)
这篇关于防止访问更改查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!