获取SetWarnings的价值 [英] Get the value of SetWarnings

查看:83
本文介绍了获取SetWarnings的价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我使用

DoCmd.SetWarnings = False语句来抑制Ms数据库中的警告。但是我想获得所有

列表之间产生的警告:


DoCmd.SetWarnings False和DoCmd.SetWarnings True


请建议。


谢谢和问候,

Pradeep Varma


* **通过开发人员指南 http://www.developersdex.com 发送***

Hello,

I am suppressing the warnings in Ms Access database by using the
DoCmd.SetWarnings=False statement. However I want to get a list of all
the Warnings that were generated between a:

DoCmd.SetWarnings False and DoCmd.SetWarnings True

Please Suggest.

Thanks and Regards,
Pradeep Varma

*** Sent via Developersdex http://www.developersdex.com ***

推荐答案

不幸的是,Access没有公开这个值。


您可以创建一个公共变量并自己跟踪它,但是使用Execute方法更好

,因为它:

a)不需要关闭SetWarnings;

b)可以给你指示动作查询未能完成;

c)可以告诉你受影响的记录数量;

d)可用于交易中获取全部或全部结果。


-

Allen Browne - Microso ft MVP。西澳大利亚州珀斯。

访问用户提示 - http:// allenbrowne.com/tips.html

回复群组,而不是mvps dot org的allenbrowne。


" Pradeep Varma" < PR *********** @ rediffmail.com>在消息中写道

新闻:rW ************* @ news.uswest.net ...
Unfortunatly, Access does not expose this value.

You could create a public variable and track it yourself, but it is much
better to use the Execute method, since it:
a) does not need to turn SetWarnings off;
b) can give you an indication of the action query fails to complete;
c) can give you an indication of the number of records affected;
d) can be used in a transaction to get an all or nothing result.

--
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.

"Pradeep Varma" <pr***********@rediffmail.com> wrote in message
news:rW*************@news.uswest.net...
你好,

我使用
DoCmd.SetWarnings = False语句来抑制Access数据库中的警告。但是我想获得一个列表,列出所有在以下之间生成的警告:

DoCmd.SetWarnings False和DoCmd.SetWarnings True
Hello,

I am suppressing the warnings in Ms Access database by using the
DoCmd.SetWarnings=False statement. However I want to get a list of all
the Warnings that were generated between a:

DoCmd.SetWarnings False and DoCmd.SetWarnings True



对不起,我没有找到你。如果Access没有公开它,我怎么能使用

公共变量来跟踪它。我请求你提供

我能够深入了解如何使用公共变量跟踪价值

,因为它也没有进入错误处理程序。


干杯,


Pradeep Varma


***通过Developersdex发送 http://www.developersdex.com ***
I am sorry I did not get you. How could I keep track of it using a
public variable if Access does not expose it. I request you to provide
me an insight into how i could track the value using a public variable
as it does not go into the error handler too.

Cheers,

Pradeep Varma

*** Sent via Developersdex http://www.developersdex.com ***


Set每次更改SetWarning时的变量。


示例:

公共bWarnings为布尔值

公共函数DoSetWarning(bOn as Boolean)

DoCmd.SetWarnings bOn

bwarnings = bOn

结束功能


您现在可以测试bWarnings任何地方,只要你的所有代码通过你的功能切换这个

设置。


-

Allen Browne - 微软MVP。西澳大利亚州珀斯。

访问用户提示 - http:// allenbrowne.com/tips.html

回复群组,而不是mvps dot org的allenbrowne。


" Pradeep Varma" < PR *********** @ rediffmail.com>在消息中写道

新闻:YL ************** @ news.uswest.net ...
Set your variable every time you change SetWarnings.

Example:
Public bWarnings As Boolean
Public Function DoSetWarning(bOn as Boolean)
DoCmd.SetWarnings bOn
bWarnings = bOn
End Function

You can now test bWarnings anywhere, provided all your code toggles this
setting via your function.

--
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.

"Pradeep Varma" <pr***********@rediffmail.com> wrote in message
news:YL**************@news.uswest.net...
对不起我做了没有得到你。如果Access没有公开它,我怎么能使用
公共变量来跟踪它。我请求您提供一个洞察我如何使用公共变量跟踪值的信息
因为它也不会进入错误处理程序。
I am sorry I did not get you. How could I keep track of it using a
public variable if Access does not expose it. I request you to provide
me an insight into how i could track the value using a public variable
as it does not go into the error handler too.



这篇关于获取SetWarnings的价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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