?
Solved

Insert data from a view in one access databse and insert to an empty table in another access db

Posted on 2010-11-17
11
Medium Priority
?
219 Views
Last Modified: 2012-05-10
I have a view that is used to provide data on a web page. The access db is becoming to big to transport the entire db to the web server. How do I script the

Insert into table2 (values) Select * from table1

Where the tables reside in 2 different dbs?
0
Comment
Question by:BPWALKIN
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 4

Accepted Solution

by:
incerc earned 1500 total points
ID: 34154662
Hi,

In the database where you have the data, create the following query :

SELECT * INTO Table2 IN 'path_to_my_second_database'
FROM Table1;

(example of above path :)
SELECT * INTO Table2 IN 'C:\Documents and Settings\user\My Documents\Database2.accdb'
FROM Table1;

You didn't say which version of Access you are using, I tested this on Access 2007.
Here is the SELECT .. INTO syntax :

http://msdn.microsoft.com/en-us/library/bb208934%28v=office.12%29.aspx
0
 
LVL 6

Expert Comment

by:YohanF
ID: 34154675
why dont you create the table in the other database, link it to your main database. So the actual table will reside in the main db and a link to that in the massive (slow) db.

Then when the updating time comes up, do a delete all query and add teh records.. This may be a way to get around your problem.. Give it a think!
0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 500 total points
ID: 34154694

insert into table2 in 'c:\myfolder\otherdb.mdb'
select * from table1


0
What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

 

Author Comment

by:BPWALKIN
ID: 34155889
using incerc's solution

I get the microsoft jet database engine has stopped the process because you and another user are attempting to change the data at the same time

this is in two test datbases where no one else is connected
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34155921
if you want to append records to an existing table, use "Insert into ..."
see my post at http:#a34154694

the
"select into..." is a make table query, that will create the table in the other db.
0
 
LVL 4

Expert Comment

by:incerc
ID: 34156129
Indeed, I confirm that the "Select .. into" creates the tables. But I thought that this is better than using "insert into.." because you don't need to create manually the table.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34156230
well, from the title of the Q. it is an 'empty table' , so the table already exists
0
 

Author Comment

by:BPWALKIN
ID: 34156232
it would be better to create the table on the fly and delete each day with ne data.

What could be the possible causes of that error.
0
 

Author Comment

by:BPWALKIN
ID: 34156236
my apologies I should have been clearer
0
 
LVL 4

Expert Comment

by:incerc
ID: 34156256
For the error you received, please see this thread :

http://www.tek-tips.com/viewthread.cfm?qid=226588&page=1296
0
 

Author Comment

by:BPWALKIN
ID: 34156272
I got it, I ran the compact and repair and it worked fine.

Thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

719 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