可以使用弹出窗体输入SQL吗? [英] Can a popup form be used to enter SQL?

查看:129
本文介绍了可以使用弹出窗体输入SQL吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有最佳做法运行临时SQL查询的方法?


私有cmdRun_Click()

strSql =我!txtBox

DoCmd.RunSQL strSql

结束次级

???

访问是否有内置方式为此目的调出一个窗口?

解决方案

On Sun,2004年1月18日16:08:11 GMT in comp.databases.ms-access,deko

< dj **** @ hotmail.com>写道:

是否有最佳做法运行临时SQL查询的方法?

私有cmdRun_Click()
strSql =我!txtBox
DoCmd.RunSQL strSql
结束子


那是关于我在我的内容以及大红色免责声明

关于用户自行承担此风险等等,尽管我没有

通常让用户可以访问它。

访问是否有内置的方式为此目的打开一个窗口?




只是查询,SQL视图。


-

A)bort,R)etry,I)用大锤子影响。


"杰科" < DJ **** @ hotmail.com>在消息中写道

新闻:Lb ****************** @ newssvr25.news.prodigy.c om ...

是否有最佳做法运行临时SQL查询的方法?

私有cmdRun_Click()
strSql =我!txtBox
DoCmd.RunSQL strSql
结束子
???
访问是否有内置的方式为此目的调出一个窗口?



不一定是内置的但很容易编码。


设置qItem = db.CreateQueryDef(" queryName",me.txtBox)

DoCmd.OpenQuery" queryName", acReadOnly

设置qItem = Nothing

''稍后你必须删除QUERYDEF

DoCmd.DeleteObject acQuery, 查询名称


访问权限没有内置的内容,但您可以使用查询设计的SQLview

基本上做同样的事情,它可能有点

更安全。此外,RunSQL方法仅适用于动作查询,因此如果

用户只想收集一个列表,那么这将无济于事。


Mike Storr
www.veraccess.com

" ;杰科" < DJ **** @ hotmail.com>在消息中写道

新闻:Lb ****************** @ newssvr25.news.prodigy.c om ...

是否有最佳做法运行临时SQL查询的方法?

私有cmdRun_Click()
strSql =我!txtBox
DoCmd.RunSQL strSql
结束子
???
访问是否有内置的方法为此目的打开一个窗口?



Is there a "best practices" way to run ad hoc SQL queries?

Private cmdRun_Click()
strSql = Me!txtBox
DoCmd.RunSQL strSql
End Sub
???
Does access have a built-in way to bring up a window for this purpose?

解决方案

On Sun, 18 Jan 2004 16:08:11 GMT in comp.databases.ms-access, "deko"
<dj****@hotmail.com> wrote:

Is there a "best practices" way to run ad hoc SQL queries?

Private cmdRun_Click()
strSql = Me!txtBox
DoCmd.RunSQL strSql
End Sub
That''s about what I have in mine along with the big red disclaimer
about users doing this at their own risk, etc. although I don''t
usually let users have access to that.
Does access have a built-in way to bring up a window for this purpose?



Just the queries, SQL view.

--
A)bort, R)etry, I)nfluence with large hammer.


"deko" <dj****@hotmail.com> wrote in message
news:Lb******************@newssvr25.news.prodigy.c om...

Is there a "best practices" way to run ad hoc SQL queries?

Private cmdRun_Click()
strSql = Me!txtBox
DoCmd.RunSQL strSql
End Sub
???
Does access have a built-in way to bring up a window for this purpose?


Not necessarily "built-in" but easy to code.

Set qItem = db.CreateQueryDef("queryName", me.txtBox)
DoCmd.OpenQuery "queryName", , acReadOnly
Set qItem = Nothing
''LATER YOU''LL HAVE TO DELETE THE QUERYDEF

DoCmd.DeleteObject acQuery, "query name"


Access dosen''t have anything like that built in, but you can use the SQLview
of the query deisgn to essentially do the same thing, and it may be a bit
safer. Also, the RunSQL method only works with action queries, so if the
user just wants to gather a list, then this won''t help.

Mike Storr
www.veraccess.com
"deko" <dj****@hotmail.com> wrote in message
news:Lb******************@newssvr25.news.prodigy.c om...

Is there a "best practices" way to run ad hoc SQL queries?

Private cmdRun_Click()
strSql = Me!txtBox
DoCmd.RunSQL strSql
End Sub
???
Does access have a built-in way to bring up a window for this purpose?



这篇关于可以使用弹出窗体输入SQL吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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