Solved

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

Posted on 2001-06-20
4
118 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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB6 - Compare and highlight cell not the same 3 49
Add and format columns in vb6 7 55
Protecting vb6 & .Net code Obfuscation 18 121
Excel Automation VBA 19 67
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…

813 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

11 Experts available now in Live!

Get 1:1 Help Now