Upgrade database

R

Raul Sousa

Is there any way to export several tables and query from database A to
database B?
My idea is to make available an upgrade to a database I created, that anyone
can use.
 
A

Allen Browne

There are several ways to export a table to other databases, e.g.:

- Select the table in design view, and choose File | Export.
- Create a Make Table query, and choose "In another database."
- CopyObject
- TransferDatabase

Some of those can be automated in a macro or in code.

Before you do that, though, have you thought about the relationships between
the tables?

If you want to duplicate the entire database, it may be simpler just to
close Access, and copy'n'paste the mdb file in the Windows Explorer.
 
R

Raul Sousa

Thank you allen for your reply.
I made an error on my post.
I need to export several queries and reports. not tables.
so far i have been doing this using the file | export option. but this way
it must be donne for each object to be exported.
I want to do it with a single command. so, any user can do it.

"Allen Browne" escreveu:
 
A

Allen Browne

Okay, export to what?

To another database? Use the TransferDatabase method (in code) or action (in
a macro.)

To an Excel file? Use TransferSpreadsheet

To a text file? TransferText.
 
R

Raul Sousa

Hello, once again.
I have tried transferdatabase method. It solves my question.
There are two things I would like to improve, nevertheless.
1. I have this code to indicate the location of the database:
Dim fUPGPath As String
fUPGPath = "C:\Users\Raul\Documents\Libritalia\ gestao2.mdb"
Instead of this I would like to have the user negating to the location. Any
ideas how to achieve this? Something like a dialog box?
2. I would like to export a custom menu too. Is this possible?


"Allen Browne" escreveu:
 
A

Allen Browne

Re 1, here is the code you need to pop up the FileOpen dialog so the user
can choose the path and file to export to:
http://www.mvps.org/access/api/api0001.htm

Re 2, you can manually open the target database, and import menus, toolbars,
and import/export specifications. In Access 2007, click the External Data
tab of the ribbbon, click the Access icon on the import chunk, and select
the database. In earlier verions, go to File | Get External | Import. Once
you have the Import Objects dialog, click the Options to extend the dialog
downwards, and check the boxes at the bottom for what you want to import.

Michka has a tool to import/export the imp/export specs here:
http://www.trigeminal.com/lang/1033/utility.asp?ItemID=4#4
but I don't see one for custom menus/toolbars.

Again, the simplest way is to make a copy of the original file, while Access
is not open.
 
Top