473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

OpenCurrentDatabase without invoking Autoexed

Hello,

I would like to have one Access program scan a directory and look at the form,
report and module code of any Access databases it finds to search for
keywords.

The best way I have found to do this is with the OpenCurrentDatabase method of
an Access.Application object. However this starts the DB having it do
whatever it would do when it starts up, which may involve refreshing data from
other DB which it cannot find, etc. I would like something like
OpenCurrentDatabase, but which would have the effect of opening the DB with
the shift key pressed.

The only other way I have found that might work would be to use the
containers("forms"), etc. collection from a DAO.Database object. But this
just gets the names of the objects of interest. To get at the module code I
would have to import each form into my DB to look at the code. This does not
seem as clean as I would like it.

Any ideas?

TIA
May 1 '06 #1
3 5971
Hi, Gary.
I would like something like OpenCurrentDatabase, but which would have the
effect of opening the DB with the shift key pressed.
Wish for something, and it might come true. If the AllowBypass Key hasn't
been disabled, then you can use the Windows API to programmatically press
the <SHIFT> key. Use the code on the following Web page:

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

Within the fGetRefNoAutoexec( ) function, you can write your code that you
need to automate the remote database, or even call a local procedure to run
right after the remote database is opened. For example:

' Open a mdb with Autoexec
Call .OpenCurrentDatabase(strMDBPath, False)

' Do whatever in this section to automate the remote DB.
Call mySub

' Revert back keyboard state
Call SetKeyboardState(abytCodesSrc(0))

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"Gary Floam" <fl***@comcast.net> wrote in message
news:7K******************************@comcast.com. .. Hello,

I would like to have one Access program scan a directory and look at the
form, report and module code of any Access databases it finds to search
for keywords.

The best way I have found to do this is with the OpenCurrentDatabase
method of an Access.Application object. However this starts the DB having
it do whatever it would do when it starts up, which may involve refreshing
data from other DB which it cannot find, etc. I would like something like
OpenCurrentDatabase, but which would have the effect of opening the DB
with the shift key pressed.

The only other way I have found that might work would be to use the
containers("forms"), etc. collection from a DAO.Database object. But this
just gets the names of the objects of interest. To get at the module code
I would have to import each form into my DB to look at the code. This
does not seem as clean as I would like it.

Any ideas?

TIA

May 1 '06 #2
Thanks Gunny,

I never would have figured this out on my own.

Gary
May 1 '06 #3
You're welcome. Glad to help.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"Gary Floam" <fl***@comcast.net> wrote in message
news:ut******************************@comcast.com. ..
Thanks Gunny,

I never would have figured this out on my own.

Gary

May 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Hal Vaughan | last post by:
I have a class that is sometimes called from the command line and sometimes from another class. When the user clicks "Quit" on the panel it opens, if it is running from the command line, it...
4
by: Tian | last post by:
In Windows, I have been simply using os.system() to run command line program in python. but there will be a black console window. How can I run the program without invoking that window? i guess...
12
by: km | last post by:
hi all, can any linux command be invoked/ executed without using shell (bash) ? what abt security concerns ? regards, KM
2
by: Zachariah | last post by:
Part of a Windows Service app I created in .NET 2003 has the following code: Dim stOutPath As String Dim stTableName As String Const strDBPath As String = "C:\test_be.mdb" acApp = New...
4
by: Paul M | last post by:
Hello, when I execute the code below I get the usual access message: SECURITY WARNING---------------------------------- Opening "<filepath & name.mdb>" The file may not be safe if it...
22
by: ypjofficial | last post by:
Is there any possibility of invoking the member functions of a class without creating an object (or even a pointer to ) of that class. eg. #include <iostream.h> class test { public: void...
1
by: PeterDavis | last post by:
Using Access 2002 on Windows xp I use the OpenCurrentDatabase method to open another database file. The method works well on some workstations but on others, Access crashes immediately and the...
0
by: Matthew Wells | last post by:
How do I use OpencurrentDatabase with /user and /pwd? There doesn't seem to be a parameter for that. There is for the database pasword, but I don't need that. I'm trying to use this line without...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.