使用表单变量Access 2003进行操作传递 [英] Action pass-through with a form variable Access 2003

查看:73
本文介绍了使用表单变量Access 2003进行操作传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个传递查询(需要大约15分钟来处理)

我想将变量集成到它。

IE:简单的东西:

从empl_Lst中选择EmplID

其中empl_lst.timestamp在[Forms]之间![MainForm]![StrMonth]和

[Forms]! [MainForm]![Endmonth]


不知道怎么做(如果它是Access或宏中的查询)

连接将是ODBC 。


我有点新手来创建查询和宏,但我学习快速的loll。

谢谢。

Hi, I got a pass-through query (that takes about 15 mins to process)
I would like to integrate variables to it.
IE: something simple:
Select EmplID from empl_Lst
where empl_lst.timestamp between [Forms]![MainForm]![StrMonth] And
[Forms]![MainForm]![Endmonth]

Not sure how to do so (should it be a query in Access or a macro)
The connection would be ODBC.

I''m a bit new to create queries and macros but I learn fast loll.
Thank you.

推荐答案

你不能将变量集成到传递查询中。因为那些

变量不存在于它将执行的服务器上。然而,你可以使用这些变量的值(表格上的控件,

顺便说一句,不是变量)在Access中术语)并构造SQL

(在服务器的SQL方言中,而不是Access方言)传递给

服务器。通过使用传递查询告诉Jet和ODBC将它完全单独留下来......通过它正如您所写的那样。


您可以在常规查询中使用变量,这些变量将首先由

Jet或ACCDB数据库引擎处理转到ODBC驱动程序。

并非每个来自Access的查询在服务器上执行都需要一个

传递查询,但如果你有/可以编写SQL,

传递查询可能会执行得更快。


另一个注意事项:在某些服务器中,例如,MS SQL Server,时间戳"是一种特殊的

类型的字段,而不是日期和时间字段。正如你在Access中所了解的那样。


Larry Linson

Microsoft Office Access MVP

" magickarle" < ma ******** @ hotmail.comwrote in message

news:9b ********************** ************ @ k13g2000 hse.googlegroups.com ...
You can''t "integrate variables into a pass-through query" because those
variables don''t exist on the server where it will execute. What you can
do, however, is to use the values of those variables (Controls on a Form,
just By The Way, are not "variables" in Access terms) and construct the SQL
(in the Server''s dialect of SQL, not the Access dialect) to pass to the
server. By using a Pass-Through Query are telling Jet and ODBC to leave it
completely alone... to "pass it through" exactly as you have written it.

You can use variables in a regular query that will first be processed by the
Jet or ACCDB database engine before being handed over to the ODBC driver.
Not every query from Access that is executed on a server need be a
"pass-through query", but if you have / can write the SQL,
pass-through-queries may execute a bit faster.

Another note: in some servers, e.g., MS SQL Server, "timestamp" is a special
type of field, not a "date and time" as you know them in Access.

Larry Linson
Microsoft Office Access MVP
"magickarle" <ma********@hotmail.comwrote in message
news:9b**********************************@k13g2000 hse.googlegroups.com...

我有一个传递查询(需要大约15分钟来处理)

我想将变量集成到它。

IE:简单的东西:

从empl_Lst中选择EmplID

其中empl_lst.timestamp介于[Forms]![MainForm]![StrMonth]和

[Forms]![MainForm]![Endmonth]


不知道怎么做(如果它是Access或宏中的查询)

连接将是ODBC。


我' '有点新的创建查询和宏但我学习快速的loll。

谢谢。
Hi, I got a pass-through query (that takes about 15 mins to process)
I would like to integrate variables to it.
IE: something simple:
Select EmplID from empl_Lst
where empl_lst.timestamp between [Forms]![MainForm]![StrMonth] And
[Forms]![MainForm]![Endmonth]

Not sure how to do so (should it be a query in Access or a macro)
The connection would be ODBC.

I''m a bit new to create queries and macros but I learn fast loll.
Thank you.



Larry Linson写道:
Larry Linson wrote:

> [...]
其中empl_lst.timestamp介于...
>[...]
where empl_lst.timestamp between ...



[...]

另一个注意:在某些服务器中,例如,MS SQL Server,timestamp,是一种特殊的

类型的字段,而不是日期和时间字段。正如你在Access中所了解的那样。

[...]
Another note: in some servers, e.g., MS SQL Server, "timestamp" is a special
type of field, not a "date and time" as you know them in Access.



....因此是一个不应该用作字段名称的关键字。


-

Peter Doering [MVP Access]

.... and is therefore a keyword that should not be used as field name.

--
Peter Doering [MVP Access]


magickarle< ma ******** @ hotmail.comwrote in news:9bdf57af-8cd2- 4dff-9861-
3a**********@k13g2000hse.googlegroups。 com
magickarle <ma********@hotmail.comwrote in news:9bdf57af-8cd2-4dff-9861-
3a**********@k13g2000hse.googlegroups.com:

我有一个传递查询(大约需要15分钟来处理)

我会喜欢将变量集成到它。
Hi, I got a pass-through query (that takes about 15 mins to process)
I would like to integrate variables to it.



振作起来。一切都没有丢失。如果你说200个冰雹玛丽并用马毛鞭打了一个月,每晚打你自己

你可能会被原谅。

Cheer up. All is not lost. If you say 200 Hail Marys and beat yourself
nightly with a horse hair whip for a month you may be forgiven.


这篇关于使用表单变量Access 2003进行操作传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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