Solved

Export table from foo.mdb to bar.mdb

Posted on 2008-06-17
2
215 Views
Last Modified: 2013-11-27
I need the vb command to export a table from one database to another database.

Please note that I am not trying to accomplish andthing like:
DoCmd.OutputTo acOutputTable, tableFoo, acFormatRTF, "C:\FooFolder\FooFile.rtf"
(Export to an RTF file)
or:
DoCmd.OutputTo acOutputTable, tableFoo, acFormatXLS, "C:\FooFolder\FooFile.xls"
(Export to an Excel file)
or:
DoCmd.OutputTo acOutputTable, tableFoo, acFormatTXT, "C:\FooFolder\FooFile.txt"
(Export to a text file)

I need to have a button on a form in foo.mdb that, when clicked, will copy it's own tableFoo from itself into another access database located at C:\FooFolder\bar.mdb

1) I don't actually want to get this out of Access format into something else, just copy it from one Access database to another one.
2) I've Googled this an fonund a lot of "the acFormatRTF" export is broken or "the acFormatXLS" export truncates blah... blah... blah..." so I'm not interested in taking the data out of Access format at all since I'm worried that will break the data. (Especially since there are some long memo fields.)
0
Comment
Question by:mcj
2 Comments
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 125 total points
Comment Utility
Use the DoCmd.TransferDatabase method
0
 

Author Comment

by:mcj
Comment Utility
Perfect! Thanks!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now