How to restrict MS Access DB to open

寵の児 提交于 2020-01-06 06:55:13

问题


I am connecting to MS Access DB using vb.net as given below...

oDBEngine = oAccess.DBEngine oDB = oDBEngine.OpenDatabase(Name:=strFullFileName, Options:=False, ReadOnly:=False, Connect:="")

And then opening the DB using the following syntex...

oAccess.OpenCurrentDatabase(filepath:=strFullFileName, Exclusive:=False)

Now my problem is:

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?

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.


回答1:


You could try 'programmatically pressing the shift-key' through APIs:

http://www.mvps.org/access/api/api0068.htm




回答2:


In your previous post on this topic : How to prevent to open a MS Access Database while reading data from forms, I suggested importing the forms into a blank database, you did not mention why this option did not suit, and I am curious as to why.



来源:https://stackoverflow.com/questions/435206/how-to-restrict-ms-access-db-to-open

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!