Suman
Suman

Reputation: 433

How to restrict MS Access DB to open

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.

Upvotes: 0

Views: 843

Answers (2)

Fionnuala
Fionnuala

Reputation: 91376

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

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

Upvotes: 1

Fionnuala
Fionnuala

Reputation: 91376

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.

Upvotes: 0

Related Questions