473,396 Members | 1,998 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.

exporting records in multiple table databases

1
Hello,

I use access 2003 and attempting to export/copy records between two access databases (almost identical) with multiple tables (both databases having the same relations between the tables).
I have no problems exporting records with an addition query for a single table into a singel table of the other database.
However, i would like to create a function to export the records in one go from the multiple tables in the first database to the multiple tables in the second.
I tried combining SQL of the single addition queries as well as creating a macro, but it doesn't work.

This exporting of records has to be done repeatedly an manual because of privacy affairs.

Tnx in advance
Apr 22 '09 #1
2 2040
DonRayner
489 Expert 256MB
Here is an example of how you could step through the tables in your database and using the table name run a specific sql statement.

Expand|Select|Wrap|Line Numbers
  1. Dim tbl As TableDef, stSQL as string
  2. Dim db As DAO.Database
  3. Set db = CurrentDb()
  4. For Each tbl In db.TableDefs
  5.     SelectCase tbl.name
  6.     Case is = "Table1"
  7.         stSQL = "Enter Your SQL Here"
  8.     Case is = "Table2"
  9.         stSQL = "Enter Your SQL Here"
  10.  
  11.     Continue Cases with all your table names here
  12.  
  13.     End Select
  14.     DoCmd.RunSql stSQL
  15. Next tbl
Apr 22 '09 #2
NeoPa
32,556 Expert Mod 16PB
You could set up a FrontEnd (FE) database that used both of the other databases as BackEnds (BEs).

This FE would copy from one to the other using simple SQL (QueryDefs whatever). You could even link a whole bunch of them together in sequence very similarly to how Don has already illustrated.

Welcome to Bytes!
Apr 23 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works...
8
by: tom | last post by:
I am new to SQL administration. >From a list of IDs that are the primary key in one table (i.e. Customer Table), I want to make changes in tables that use those IDs as a foreign key. ...
3
by: Htk | last post by:
I have two access databases. A and B Both have a table with the same name (tbl_data entry) ie. same structure/data. I want to be able to transfer (export) data in this table from database A to...
21
by: bobh | last post by:
Hi All, In Access97 I have a table that's greater than 65k records and I'm looking for a VBA way to export the records to Excel. Anyone have vba code to export from access to excel and have the...
6
by: kenshiro | last post by:
Hi All, I'm having a problem with some VBA code in one of my Access 2003 databases. I'm getting the following error when running code behind a command button on a form: "Item not found in this...
2
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to...
6
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
3
aryanraj
by: aryanraj | last post by:
Hi all, I wanted to export around 300000 records that are present in my MS Access 2003 version table to excelsheet version8. I had written a code to export to multiple sheets in one workbook,...
7
by: emajka21 | last post by:
I have been working on creating a HR database. Everything is working fine there but now they want a training database. I basically need a few fields from the employee table and I need the full...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
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.