Solved

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

Posted on 2001-06-20
4
117 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
4 Comments
 
LVL 6

Accepted Solution

by:
sharmon earned 200 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
This was the conclusion I was trying to avoid, but it seems like the only/best answer.
Thanks.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now