问题描述
我正在使用 vb.net 连接到 MS Access DB ,如下所示...
I am connecting to MS Access DB using vb.net as given below...
oDBEngine = oAccess.DBEngineoDB = oDBEngine.OpenDatabase(名称:= strFullFileName,选项:= False,ReadOnly:= False,Connect:=")
oDBEngine = oAccess.DBEngineoDB = oDBEngine.OpenDatabase(Name:=strFullFileName, Options:=False, ReadOnly:=False, Connect:="")
然后使用以下语法打开数据库...
And then opening the DB using the following syntex...
oAccess.OpenCurrentDatabase(filepath:= strFullFileName,Exclusive:= False)
现在我的问题是:
其中一个数据库包含一个表单,该表单在我们打开数据库时会自动打开.因此,当我尝试为该特定数据库运行应用程序时,该数据库将打开.但是根据我的要求,我不需要显式打开数据库.
One of the DB contains a form which opens Automatically while we are opening the DB. So when I am trying to run the application for this particular DB the DB opens up. But as per my requirement I do not need to open the DB explicitly.
在这种情况下是否有任何方法可以限制数据库打开?
Is there any way to restrict the DB to open in such cases?
注意:这在所有其他情况下都可以正常工作,即数据库没有打开,但是我可以根据我的应用程序需求对每种表单的Activex控件进行计数.
NOTE: This works fine for all other scenarios i.e. DB is not opening, but I can able to count Activex controls form each form as per my application requirement.
推荐答案
您可以尝试通过API以编程方式按下Shift键":
You could try 'programmatically pressing the shift-key' through APIs:
http://www.mvps.org/access/api/api0068.htm
这篇关于如何限制MS Access DB打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!