Transfering data from one database to another

Zibinette

New Member
Joined
Feb 4, 2003
Messages
2
Hi, wonder if anyone can help me...
Trying to transfer part of the information contained in a table into another table, but the fields don't have exactly the same names in one and the other. Example : I have a table with contact info and history of purchases. And I want to transfer the contact info in a contact table and the history of purchases info in a history table.
Thanks !!
Z.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi, you could make a new table (make table query) or alternatively use an append query (to add as new records) or update query (to update existing records) but you will need some link between the tables so Access knows which records to update. You can use the Relationship button to link tables.
 
Upvote 0
Hi There,
You could also use a Select Into sql statement.

Here is sample that I just used on a project.

Const dbloc = "V:\DataBases\"

Sub TransferData()

Dim db As ADODB.Connection
Dim sql1 As String

Set db = Application.CurrentProject.Connection

sql1 = "select * INTO tblContracts IN '" & dbloc & "ReviewQ1-1078.mdb ' from qryContract_Final_Output WHERE [MGR MKT LOC]=1078"


db.Execute (sql1)

set sql = nothing
set db = nothing
end sub


Just change the * to the fields you want to append.


Hope this helps!

Dan
 
Upvote 0

Forum statistics

Threads
1,221,510
Messages
6,160,230
Members
451,632
Latest member
purpleflower26

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top