473,671 Members | 2,370 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

exporting records in multiple table databases

1 New Member
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 2056
DonRayner
489 Recognized Expert Contributor
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,569 Recognized Expert Moderator MVP
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
9238
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 only exporting to single worksheet. but i need to export data to multiple worksheets. it is very urgent to us. so please help me in code.
8
4323
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. Basically I want to say: If fk_ID is in list then do these statements to that record
3
2161
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 the same named table in database B - but i want the transferred data to be ADDED to existing data already in database B. I have tried the append query method but that simply REPLACES the existing table data in B with the incoming data from...
21
6224
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 code use multiple excel tabs within a workbook???? Anyone have vba code that would create a temp table write 65,000 records to it, export those to excel, clean the temp table, append the next 65,000 records, export it to excel with a different...
6
2474
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 collection". I suspect it has something to do with parameters in the query I'm calling. I need to pass an object on the form to a parameter in the query, and the query is quite complex as well. Here is the query:
2
3170
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 set this up so as to do it reliably and minimize overhead? There are currently no constraints on the destination table. Assume the user or some configuration specifies the database name, server name, and filename+fullpath. The server is SQL...
6
9414
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 report" button located on my form to print all of the list box values (that have been updated via selection from combo boxes) from the form to the report. I've tried using a macro with the code: Macro Name: cmdGenerateReport : On Click Action:...
3
10158
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, but i failed to export the continous records. The code is exporting only the first 65536 records to multiple sheets. I want to find a way for this. --I tried to include an auto number field to my table but it was not successful. --I tried to...
7
2886
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 department table. I also need the position titles table along with 1 additional field. I was able to export everything fine to the new database. Is there a way to update the training database when data is updated in the HR database. I figured out...
0
8390
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8909
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8596
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8667
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6222
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5690
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4221
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4399
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1801
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.