Connecting Tech Pros Worldwide Forums | Help | Site Map

Run Compact & Repair/Import Externally

pwh777
Guest
 
Posts: n/a
#1: Nov 13 '05
I have three databases. DB1 has a button on a form. When I click that
button, I want to import all the objects from DB2 to DB3 (just as you
would if you would chose the File > Get External Data > Import menu
option). Then I want to Compact and Repair DB3. I want to do this all
by pushing the button in DB1.

Is this possible?


pwh777
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Run Compact & Repair/Import Externally


Chuck Grimsby wrote:
[color=blue]
> Yes, it's possible. What part are you having a problem with?[/color]


Both! I tried by creating two database objects. I was successful in
looping through the TableDefs of the database I was copying from. But
I was not successful in appending them to the second database object.
I don't have my code with me right now. When I do I'll paste it.

I have no idea how to do the Compact and Repair externally. If you
have some sample code or a link to some, I would appreciate it!
Thanks in advance for any help!

pwh777
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Run Compact & Repair/Import Externally


Chuck Grimsby wrote:
[color=blue]
> Yes, it's possible. What part are you having a problem with?[/color]


Both! I tried by creating two database objects. I was successful in
looping through the TableDefs of the database I was copying from. But
I was not successful in appending them to the second database object.
I don't have my code with me right now. When I do I'll paste it.

I have no idea how to do the Compact and Repair externally. If you
have some sample code or a link to some, I would appreciate it!
Thanks in advance for any help!

pwh777
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Run Compact & Repair/Import Externally


Thanks again for the reply Chuck.

The example I gave (DB1, DB2, etc.) is just an example. I have a
number of apps (.MDBs) that are

used by my company. The data is stored in tables on SQL Server. My
..MDBs contain the forms,

reports, queries, macros and modules and they link to the SQL Server
tables.

Every time that a developer makes enhancements to an app they must go
through a procedure to make

sure the app is clean and is as small as possible. First, the
developer will open CleanDatabase.MDB. This database contains one
common module and one common macro. Then they import every object
(except for the common module and macro) into CleanDatabase.MDB from
the app they just changed.

Then the developer relinks all the tables, Compacts and Repairs the DB
and runs the common macro to lock it down. The CleanDatabase.MDB is
renamed to the name of the app that was enhanced and then it is pushed
out into production.

I would like to do all that programmatically rather than have it done
manually.

Closed Thread