通过自动化启动Access时未发出警告 [英] No warnings issued when Access is started via Automation

查看:73
本文介绍了通过自动化启动Access时未发出警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好 - 我是这个论坛的新手。


从Access实例运行应用程序时遇到问题

已经通过自动化启动(早期或晚期绑定,没有

差异)。


没有发出警告/确认消息(例如,当运行时

查询,删除数据表中的记录,删除数据库对象,如

表格。


就好像我已经执行了命令DoCmd.SetWarnings False,但是我没有b $ b。如果我明确执行命令DoCmd.SetWarnings True

(试图强制显示警告),这没有区别

也 - 我仍然收到没有警告或确认。


如果我从Access的实例运行完全相同的数据库

正常启动Access(手动),一切正常我收到

警告,确认等等。


这是不可取的,因为我希望用户收到可取消的

确认消息,例如当他们尝试从我的应用程序中删除

各种表单中的记录时。


我注意到在删除表单中的记录时,BeforeDelConfirm和

AfterDelConfirm事件触发后,虽然没有显示两个

事件之间的动作确认。如果有必要,我可以通过申请并为这些活动添加

代码 - 尽管我正在努力保持精简和简单,所以

宁愿避免这样做可能。


我的工作环境仅限于Access 2002(XP)Service Pack 2.


还有其他人经历过这个吗?


先谢谢 - 理查德

Hi there everyone - I''m new to this forum.

I am having an issue when running an application from an instance of Access
which has been started through automation (early or late bound, makes no
difference).

No warning / confirmation messages are issued (eg. when running action
queries, deleting records from a datasheet, deleting database objects such as
tables).

It''s as if I have executed the command "DoCmd.SetWarnings False", but I
haven''t at all. If I explicitly execute the command "DoCmd.SetWarnings True"
(in an attempt to force warnings to be displayed), this makes no difference
also - I still receive no warnings or confirmations.

If I run the very same database from an instance of Access where I have
launched Access normally (manually), everything works normally and I receive
warnings, confirmations, etc.

This is undesirable as I would like the users to receive cancellable
confirmation messages, for example when they attempt to delete records from
various forms in my applications.

I notice that when deleting records in forms, the BeforeDelConfirm and
AfterDelConfirm events fire, although no actal confirmation between the two
events is displayed. If necessary I can go through the application and add
code to such events - though I''m trying to keep things lean and simple, so
would rather avoid that if possible.

My working environment is limited to Access 2002 (XP) Service Pack 2.

Has anyone else experienced this?

Thanks in advance - Richard

推荐答案

RichardP写道:
RichardP wrote:

大家好 - 我是这个论坛的新手。


从Access实例运行应用程序时出现问题

已经通过自动化启动(早期或晚期绑定,没有

差异)。


没有发出警告/确认消息(例如,当运行动作时

查询,删除数据表中的记录,删除数据库对象,例如

表格。


它好像我已经被处死了命令DoCmd.SetWarnings False,但是我没有b $ b。如果我明确执行命令DoCmd.SetWarnings True

(试图强制显示警告),这没有区别

也 - 我仍然收到没有警告或确认。


如果我从Access的实例运行完全相同的数据库

正常启动Access(手动),一切正常我收到

警告,确认等等。


这是不可取的,因为我希望用户收到可取消的

确认消息,例如当他们尝试从我的应用程序中删除

各种表单中的记录时。


我注意到在删除表单中的记录时,BeforeDelConfirm和

AfterDelConfirm事件触发后,虽然没有显示两个

事件之间的动作确认。如果有必要,我可以通过申请并为这些活动添加

代码 - 尽管我正在努力保持精简和简单,所以

宁愿避免这样做可能。


我的工作环境仅限于Access 2002(XP)Service Pack 2.


还有其他人经历过这个吗?


提前致谢 - 理查德
Hi there everyone - I''m new to this forum.

I am having an issue when running an application from an instance of Access
which has been started through automation (early or late bound, makes no
difference).

No warning / confirmation messages are issued (eg. when running action
queries, deleting records from a datasheet, deleting database objects such as
tables).

It''s as if I have executed the command "DoCmd.SetWarnings False", but I
haven''t at all. If I explicitly execute the command "DoCmd.SetWarnings True"
(in an attempt to force warnings to be displayed), this makes no difference
also - I still receive no warnings or confirmations.

If I run the very same database from an instance of Access where I have
launched Access normally (manually), everything works normally and I receive
warnings, confirmations, etc.

This is undesirable as I would like the users to receive cancellable
confirmation messages, for example when they attempt to delete records from
various forms in my applications.

I notice that when deleting records in forms, the BeforeDelConfirm and
AfterDelConfirm events fire, although no actal confirmation between the two
events is displayed. If necessary I can go through the application and add
code to such events - though I''m trying to keep things lean and simple, so
would rather avoid that if possible.

My working environment is limited to Access 2002 (XP) Service Pack 2.

Has anyone else experienced this?

Thanks in advance - Richard



试试这个。用表格替换Table1这个单词你可以安全地删除

所有的记录。


Dim strSQL As String

Docmd .SetWarnings True

MsgBox" Execute"

strSQL =" DELETE Table1。* FROM Table1"

CurrentDb.Execute strSQL


MsgBox" RunSQL"
DoCmd.RunSQL strSQL

MsgBox" Done"

Try this. Substitute the word Table1 with a table you can safely delete
all of the records from.

Dim strSQL As String
Docmd.SetWarnings True
MsgBox "Execute"
strSQL = "DELETE Table1.* FROM Table1"
CurrentDb.Execute strSQL

MsgBox "RunSQL"
DoCmd.RunSQL strSQL
MsgBox "Done"

与上述一致。在自动化模式下,除了执行,RunSQL和完成之外,没有任何消息对话框发出



在正常模式下,我得到你将要从

指定的表格中删除n行 [是/否]确认提示对话框在RunSQL

和完成之间。消息。

salad写道:
Consistent with above. In automation mode, there aren''t any message dialogs
issued other than the "Execute", "RunSQL", and "Done".

In normal mode, I get the "You are about to delete n row(s) from the
specified table" [Yes/No] confirmation prompt dialog in between the "RunSQL"
and "Done" messages.
salad wrote:

>大家好 - 我是新来的论坛。
>Hi there everyone - I''m new to this forum.


[引用文字剪辑 - 30行]

[quoted text clipped - 30 lines]


>>
提前致谢 - 理查德
>>
Thanks in advance - Richard


试试这个。用表格替换Table1这个单词你可以安全地删除


Dim strSQL As String

Docmd.SetWarnings True

MsgBox"执行"

strSQL =" DELETE Table1。* FROM Table1"

CurrentDb.Execute strSQL

MsgBox" RunSQL"
DoCmd.RunSQL strSQL

MsgBox" Done"


Try this. Substitute the word Table1 with a table you can safely delete
all of the records from.

Dim strSQL As String
Docmd.SetWarnings True
MsgBox "Execute"
strSQL = "DELETE Table1.* FROM Table1"
CurrentDb.Execute strSQL

MsgBox "RunSQL"
DoCmd.RunSQL strSQL
MsgBox "Done"



-

通过AccessMonster.com发布消息
http://www.accessmonster.com/Uwe/For...ccess/200609/1

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200609/1


RichardP通过AccessMonster.com写道:
RichardP via AccessMonster.com wrote:

与上述一致。在自动化模式下,除了执行,RunSQL和完成之外,没有任何消息对话框发出



在正常模式下,我得到你将要从

指定的表格中删除n行 [是/否]确认提示对话框在RunSQL

和完成之间。消息。
Consistent with above. In automation mode, there aren''t any message dialogs
issued other than the "Execute", "RunSQL", and "Done".

In normal mode, I get the "You are about to delete n row(s) from the
specified table" [Yes/No] confirmation prompt dialog in between the "RunSQL"
and "Done" messages.



我想我不知道自动化模式与普通模式的含义。我用

没有收到.Execute的警告信息。我得到一个用RunSQL

请求确认。如果是这种情况,请使用Docmd.RunSQL。

I guess I don''t know what you mean by automation mode vs normal mode. I
don''t get a warning message with .Execute. I do get one with RunSQL
asking for confirmation. If that''s the case, use Docmd.RunSQL.


>

salad写道:
>
salad wrote:

>>>大家好 - 我是这个论坛的新手。
>>>Hi there everyone - I''m new to this forum.

[引用文字剪辑 - 30行]


[quoted text clipped - 30 lines]


>>>提前致谢 - Richard
>>>Thanks in advance - Richard


试试这个。用表格替换Table1这个词你可以安全地删除
来自的所有记录。

Dim strSQL As String
Docmd.SetWarnings True
MsgBox" Execute"
strSQL =" DELETE Table1。* FROM Table1"
CurrentDb.Execute strSQL
MsgBox" RunSQL"
DoCmd.RunSQL strSQL
MsgBox" ;完成"


Try this. Substitute the word Table1 with a table you can safely delete
all of the records from.

Dim strSQL As String
Docmd.SetWarnings True
MsgBox "Execute"
strSQL = "DELETE Table1.* FROM Table1"
CurrentDb.Execute strSQL

MsgBox "RunSQL"
DoCmd.RunSQL strSQL
MsgBox "Done"



这篇关于通过自动化启动Access时未发出警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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