Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how can I copy an ADO database to a new database?

Posted on 2001-06-20
4
Medium Priority
?
124 Views
Last Modified: 2010-05-02
I want to connect to a database with the ADO data control, remove or edit a bunch of records and then save it to a different place. Is this possible? I haven't found anything in the help file or in the books I've been reading.
0
Comment
Question by:chaos_59
[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 Comments
 
LVL 6

Accepted Solution

by:
sharmon earned 800 total points
ID: 6212594
Is this a file based database like Access?  If so, why don't you just copy the database file via code to this different place first, then connect to the copied database via ADO and do your updates on the copied database directly.
0
 
LVL 2

Expert Comment

by:TravisHall
ID: 6212714
What he said. (Which is to say, Sharmon deserves the points, not me.)

But also, generally you don't save a database. The database provider writes any changes you make automatically. Once you change the database, for all intents and purposes, it is changed. There is no original that you can revert to later after saving to a different file.

So with databases, copy then change, or extract then transform and import. Never change then save.
0
 
LVL 5

Expert Comment

by:gbaren
ID: 6216678
chaos,

You can use a disconnected recordset.

1. Connect to source
   rs.ActiveConnection.Open "DSN1"
2. Get a Recordset
3. Disconnect
   rs.ActiveConnection.Close
4. Update the Records
5. Connect to a different source
   rs.ActiveConnection.Open "DSN2"
6. Update
   rs.UpdateBatch

I don't know whether this would work. It does sound reasonable, though.

gbaren
0
 
LVL 1

Author Comment

by:chaos_59
ID: 6271537
This was the conclusion I was trying to avoid, but it seems like the only/best answer.
Thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

722 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