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
Solved

Writing to second database

Posted on 2000-03-15
2
209 Views
Last Modified: 2010-04-02
I have an application using Dao with an Access database. I want to allow the user to "archive" old records to a separate database and view them from the "archive" file later.
The archive file needs to be user-nameable for creation when sending the current records to the archive.
I have an empty database file (named "archive.mdb") which I can copy to a new file based on the user's input. That part is working fine. The problem comes in creating CDaoRecordset- derived objects connected to that new database file.
Not looking for code here, just the framework of the approach -- how to create and connect recordsets to a user-nameable database file, etc.
0
Comment
Question by:sonora
2 Comments
 
LVL 4

Accepted Solution

by:
abancroft earned 75 total points
ID: 2620798
I'm not sure if this is what you're looking for, but to connect to a named MDB file, create a CDaoDatabase object & call the Open() method.

e.g.
CDaoDatabase dbArchive;

dbArchive.Open("C:\\TEMP\\ARCHIVE.MDB");

CDaoRecordset rsArchive(&dbArchive);
0
 
LVL 1

Expert Comment

by:Dhrubajyoti
ID: 2622280
I think you want to use a different
database.You may declare a new database
object of type CDatabase or CDaoDatabase
Open your  database using your new Accees file.
 Open record set using the second database object and write your data into the table using the recordset opened using the second database.
 
     



         
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

837 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