473,503 Members | 3,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting text of Modules in non CurrentDB


I'm curious about getting to the text of procedures in a database other
than the current database without a new instance of Access. Note I don't
want to execute or call anything, I just want to get to the text of each
module.
No Networks involved, just multiple drives on one local machine.

<ramble>
Win98, Access 8

I don't have the self discipline to keep track of all the incidental bits
of code I write to do one off, small (or large) tasks. Sometimes I need to
sledgehammer my way through all my MDBs to find a half remembered bit of
code.

I can quite happily do what I want by ...

<dim stuff, oApp as Object ...>
DBName$ = ThatDB.mdb
Set oApp = New Access.Application
oApp.OpenCurrentDatabase DBName
Set db = oApp.CurrentDb

Then I can wander through the oDocs in db.Containers("Modules").Documents
and open the modules oApp.DoCmd.OpenModule oDoc.Name , grab all the text
sText = .Lines(1, .countOfLines) , slice things out with all those handy
tools like ProcStartLine, ProcBodyLine and such. Maybe shove it all in a
table where I can search and sort, get distracted, forget what I was after
and do something else instead.
</ramble(This Tag often ignored)

I'm puzzled about why I can't get to the other modules just by setting a
Reference to the other database.

Given these Objects.

1. The CurrentDB
Database - ThisDB.mdb
Project: - ThisDB
Module: - mThisMod
Procedure - sThisSub

I'm working in sThisSub

2. The OtherDB
Database - ThatDB.mdb
Project: - ThatDB
Module: - mThatMod
Procedure - sThatSub

While editing sThisSub, I can add a Reference to ThatDB and in the Object
Browser zip through to mThatMod, double click it, grab code or even edit
its code and save it. All very handy, thank you Access.

Now the question. When I want to talk to the text of a module in another
database:

Can I open the module and explore the entrails by setting a Reference to
the other project, rather than getting to it from another instance of
Access.Application?

If I can, should I? My gut feeling is there would be less overhead and
things would be more stable.

If I can, HOW? That was a frustrated shout. I've tried all the logical (to
me) ways of talking to the other project, IntelliSense shows me everything
I want, but my last remaining brain cell just won't tell me the syntax.

Can anyone give me a yes, no or maybe? I seem to remember Terry Kreft
talking about this many years ago.

Cheers,
Alan
Oct 23 '06 #1
0 1411

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

Similar topics

6
1703
by: Dustin Wilson | last post by:
I'm looking for a way with Visual Basic to generate a list of all the forms, reports and modules within a database. I can currently generate a list of tables and queries with the following code...
3
5656
by: JimF | last post by:
I need to scan a couple of hundred databases in several directories to locate all code that uses a particular function, but cannot figure out how to read the Form or Module text itself. I am...
13
11354
by: Richard Hollenbeck | last post by:
To prevent future apostrophe bugs and errors, isn't it just simpler to forbid an apostrophe from being entered into a text field? For example, couldn't "Alice's Restaurant" be changed to "Alices...
7
1481
by: Robert | last post by:
I want to display the name of the current database on a report. For example, if the database is "db1.mdb", I want it to say "db1.mdb" somewhere on the report. I could put a label with the value...
22
6738
by: PeteCresswell | last post by:
I've been to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mschrt/html/vbobjtitleobject.asp, but still don't have a clue. For example, I've got a chart object namde...
6
3676
by: Kevin Chambers | last post by:
Hi all-- In an attempt to commit an Access MDB to a versioning system (subversion), I'm trying to figure out how to convert a jet table's metadata to text, a la SaveAsText. The end goal is to...
25
2300
by: Eric | last post by:
Hello, after reading some of the book Programming Python it seems that python is something I would like to delve deeper into. The only thing is, I have no idea what I should try and write. So I was...
5
1941
by: MLH | last post by:
I'm using A97 import data wizard to import text file N2 a table. The text file is a DIR listing produced by running dir jdc*.* /s c:\JDCs.txt The wizard is chopping the lines off at the...
9
1676
by: RICHARD BROMBERG | last post by:
I am using Access 2000 and I would like to make a data entry form (frmDataEntry) I want to append a newrecord to a table (tblPeople) and populate the new record from two Textboxes (txtName and...
0
7261
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,...
1
6974
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
7445
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4991
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4665
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
369
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.