Programatically Bypass Startup

A

Anthony

How do I programmatically cause an external database to bypass startup
(AutoExec Macro and Startup object)?
 
A

Albert D. Kallal

Are you sure you need to do this?

you can just open an extern database, and thus read/use the data.

dim otherDB as DAO.database


set otherDB = OpenDataBase("c:\path name to other mdb")

Now, you can use any object, or read tables such as:

dim rstData as dao.RecordSet

set rstData = otherDB.Openreocrdset("select * from tblCustomers")

note that even the table defs..and other collections are available. When you
use the above, NONE of the start-up macros, or forms are triggered.

So, do you REALLY need to turn off that stuff?

Further more, you can also "transfer" other forms, queries etc by using
transferDatabase commands.

in fact, you could grab the start-up form, or start-up macro...replace it
with your own..and then you effective disabled the start-up code.

However, if it is a mde...you not going to be able to do this with forms
(but, you still can replace the autoexec macro with transferdatabase
commands).
 
A

Anthony

Thank you for your help,

But this seems awfully complicated. Isn't there some option or property I
can change like the below example?

Application.SetOption "Auto Compact", -1

Like for example:

Application.SetOption "Bypass Startup", -1

??

thx
 
R

Robert Morley

But this seems awfully complicated. Isn't there some option or property I
can change like the below example?

Nothing that I'm aware of. I know Doug responded to you in the other
"CompactOnClose Property" thread, as well as Albert's response here, but
here's another method you might want to give some thought to...it's no less
complex than Albert's method, though, even more complex, in fact.

Launch Access and open your database using the Shell command, and use the
/cmd command-line parameter to pass some text you can identify (i.e., /cmd
"No Startup"). Then you can examine the Command() function to decide what
code to execute. If you're using AutoExec, this would be even more complex,
but if you're just opening a startup form, it's not so bad.

Judging from your posts so far, though, I don't think this is the kind of
solution you're looking for. It would involve a fair amount of
re-programming, from what you've said.



Rob
 
A

Albert D. Kallal

But this seems awfully complicated. Isn't there some option or property I
can change like the below example?

I not sure what you mean. Are you talking about one appcation opening
another...or simply by-passing the start-up options in an existing
application that you are launching?

If you talking about the 2nd case..then simply hold down the shift key..and
the all the options will not run.....

Can't get more easy then that!!!

If you want to set, or un-set the shift-key by-pass options, you can grab my
utility here that lets you browse to any mdb/mde file, and enables, or
disables the shift key...
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html

So, perhaps just holding down the shift key is what you are looking for....
Like for example:
Application.SetOption "Bypass Startup", -1

Yes, but the above would assume that the applation already loaded and is
running..and that is TOO late to change those settings!!!

You can hold down the shfit key during startup however...and that will
disable all startup...perahps that is what you are looking for??

It is now not clear 'when' you need to disbale this stuff? During some code
that tryies to open antoher database, or simply for you to easily "work" on
your database?

You most certainly can, and should hide all of the ms-access interface. The
options to complete hide and keep people out of the ms-access interface can
easily be done using the tools->start-up options. Using those options allows
you to complete hide the ms-access interface (tool bars, database window
etc).

Also, using these options means you do not have to bother setting up
security.

Try downloading and running the 3rd example at my following web site that
shows a hidden ms-access interface, and NO CODE is required to do
this....but just some settings in the start-up.

Check out:

http://www.members.shaw.ca/AlbertKallal/msaccess/DownLoad.htm

After you try the application, you can exit, and then re-load the
application, but hold down the shift key to by-pass the start-up options.

Of course, during development, you will hold down the shift key so your
startup settings don't run. You then develop for awhile, and then to test in
"user" mode, you exit..and then re-enter the application without the shift
key bypassed. You will likely do this dance all day long as you run/test as
user mode, and then flip back in to developer mode (shift key used..so you
don't get the main custom menu). So, you can't develop, or really modify
things when you run your application with the startup settings...so you must
shift-by-pass them when you want to work.

And, in fact, I use alt-f4 to exit the application...the mdb file should
still be highlighted in the windows explore..so, then you hit enter key
(and, hold down shift key if you need be). This key stroke sequence and
exiting and re-entering the application will occur CONSTANTLY all day long
when you are developing.

When you finally have things just right...you create the mde
you plan to distribute. Set the shiftkey by-pass, and you are
well done...
 
G

Guest

Albert- I think you may be able to save me!

I have a perfectly working Db that, from the FE, sets security, alows users
to add certain other users, change their password, etc. HOWEVER anyone can
just open the tables from the ms-access interface! Others on the group have
suggested RWOP queries to get around this. Although it should work, it will
require so many changes that I might as well just rewrite the whole DB!! Then
I ran across the following from you

*****
Try downloading and running the 3rd example at my following web site that
shows a hidden ms-access interface, and NO CODE is required to do
this....but just some settings in the start-up.

Check out:

http://www.members.shaw.ca/AlbertKallal/msaccess/DownLoad.htm

*****
if you have a way to hide the ms-access interface (and a user can't undo it-
maybe even user level security protected??) then this would save me! Can you
tell me how to do this or where I can get the info?

afterthought- does is work with access 2003 or would the new interface of
2007 not automatically bypass it and alow them in??

Many thanks!
 
A

Albert D. Kallal

*****
if you have a way to hide the ms-access interface (and a user can't undo
it-
maybe even user level security protected??) then this would save me! Can
you
tell me how to do this or where I can get the info?


that is what that link and example does...did you try it????

I stated that you don't need security at all.....

if you create a mde, disable the shift key, then how can a user see the
forms, and tables with that example of mine???

Give that sample a try.....
 
R

Rick Brandt

Albert said:
that is what that link and example does...did you try it????

I stated that you don't need security at all.....

if you create a mde, disable the shift key, then how can a user see
the forms, and tables with that example of mine???

But without security anyone who knows how can re-enable the shift key. In
addition all the tables can simply be linked to or imported into another file
and viewed/edited from there.
 
G

Guest

thanks, i think I wanted it so bad to work that I turned my brain off. I
thought of the same thing and yes, it was easy to break into it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top